Currently, this error occurs on the wall.
I am running a node.js application with the mongojs shell for mongodb. I started mongod on the default port and then launched
var db = require('mongojs').connect('localhost:27017/my_db');
var users = db.collection('users');
users.findOne({'fb_id' : fbUserMetadata.id}, function(err, user) {
console.log(err);
console.log(user);
debugger;
});
however err and user are both "null". As far as I know, error should be populated with some data, even if it does not find anything.
How to make the callback function work correctly? Have mercy on the novice question.
source
share