dimanche 29 mars 2015

Set variable equal to mongodb key value


var userLat = db.collection('users', function (err, document){
document.findOne({_id: loggedUserID}, function(err, docs) {

console.log(docs.currentUserLat);
});


This is my code, I'm trying to get the value that's console logged into the variable. I just can't find the correct syntax to do this. The console log does return the correct value just need to drop it into the variable. Grateful for some help.


Aucun commentaire:

Enregistrer un commentaire