Vote count: 0 Hi I am using Express to work with MongoDB. I am pretty new to both. I got a find function working, it looks like this: function find (current_collection, cb) { getCollection(current_collection, function (err, collection) { collection.findOne({ 'identity.sender.id': '1234abcd' }, function (err, result) { // ... some err and cb handling }); }); } I logged the result and everything looks fine. I want to this code somewhere else, so I tried to use variables in the query and tued the function into something like this: function find (current_collection, val, cb) { getCollection(current_collection, function (err, collection) { collection.findOne({ 'identity.sender.id': val }, functio...
ادامه مطلب