Presently being driven up the wall by this error.
I am running a node.js app with the mongojs wrapper for mongodb. I Started mongod on the default port, then ran
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'. To my knowledge, err should be populated with some kind of data even if it doesn't find anything.
How do I get the callback function to work properly? Pardon the newbie question.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…