You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
LoginModel.findOne({'fbLogin.userID' : req.body.id}, function(err, doc){
//Here err is null and doc is the first (and only) object in the collection used by the LoginModel.
});
Please note that req.body.id is undefined.
I would expect this to thow an error. I tried the same thing using the mongo client and I get the following error:
db.logins.find({'fbLogin.userId': undefined})
error: { "$err" : "can't have undefined in a query expression", "code" : 13629 }
This seems like an inconsistency between mongo and mongoose.