Search Posts

Category: mongodb

MEAN advanced books [on hold]

First of all, sorry for this kind of question, learning from video tutorial is not good sometimes and that knowledge is not stable so I decided to learn from books. By googling I could get an answer, I need human recommendation who has more experience. So share everything that you found it as helpful. I believe it will be helpful for everyone. Thank you in advance. Source: AngularJS

POST 404 Error when deploying MEAN app on Heroku

I was recently following a tutorial on youtube that went over creating a MEAN application locally. I decided to try to deploy my version over heroku and run into the error when adding an item: POST 404 (Not Found) as well as GET 503(Service unavailable) Possibly unhandled rejection:{} my server.js file is: let express = require(‘express’); let app = express(); let bodyParser = require(‘body-parser’); let mongoose = require(‘mongoose’); let mongodb = require(“mongodb”); let ObjectID […]

Show subtasks(related to the task) in Angular js

Sorry if the title was confusing, I’m creating a web application which lets the user to add tasks and sub-tasks.I have managed to make angular to get the tasks from database(mongodb) and show the result in my dashboard.html file. But I’m having problems with the sub-tasks. I have a button on each task and when clicked should show all the sub-tasks which belong to that task. In the current situation the problem is that when […]

Show Angular model value in another page

thank you for helping me. I want to save the value of an input tag and show in another view page. I perform a GET request in an Angular controller and saved to DB successfully. But I’m stuck about these basic questions. The code is specified below. Why the “viewTemplatePath” in Sails Controller not work? after execusing the exits.success, the page is still not change. Why I can’t access the params of ng-model, evenif I […]

Get the source traffic origin of a specific link of my website

I have an SPA app running with angularjs + node.js (express) + mongodb, and I would like to know how can I proceed to get more information abut the traffic source of a specific link of my website. An example, i have this link: https://www.mywebsite.comm/:id, and suppose that this link has been opened from facebook or twitter and so. In this specific case, how can we proceed to know the request origin with the exact […]

Object id is missing in Django framework when posted from AngularJS MongoDB

I am posting the following object { skillName : “Professional Skills” _id : {$oid: “5adf23946ab671bf6cb36aff”} } to the DjangoService given below: @csrf_exempt @api_view([‘GET’,’POST’]) def saveSubjectView(request): #this service will add & update Subject if request.method == ‘POST’: try: stream = StringIO(request.body) subject = JSONParser().parse(stream) print(“The subejct is “) pp.pprint(subject) serializedsubject = json.loads(json_util.dumps(subject)) print(“serializedsubject”) pp.pprint(serializedsubject) The output that I am getting is ‘skillType’: { u’_id’: { }, u’skillName’: u’Professional Skills’} The ObjectId posted from the front end […]

Run Async function as Sync

I’m newer in javascript programming and i’m trying to understand async process. I’ve started a project and i would to know how to execute the code below as sync. I saw a lot of tutorials but, most of them are so superficial… The code is simple, its a call to google maps api that pass an adress and return the latitude and longitude. After that, it should call server passing lat lng through url and […]

$http GET request only working when I refresh the page

I have an AngularJS app that is connected to MongoDB. I have articles that I am pulling from the database that is then ng-repeated onto an article page. I have a button with Read More… that takes the user to the specific article. When the single article view becomes active I make a get request to the database to get the article._id. The get request is only working on page reload and not when I […]

How to get document by ID using mongoose with Angularjs

I am trying to get a single document by ID from a $http request using mongoose and Angularjs (learning Angular CLI). Any help would be greatly appreciated. I can get the id but cannot figure out how to pass it to the routing Controller for Single Article View: let _id = $routeParams; console.log(_id); $http({ cache: true, method: ‘GET’, url: ‘/article/:id’, params: { _id } }).then(function successCallback(res) { $scope.article =; }).catch(function errorCallback(err) { if (err) […]

Next Page »