Answers for "mongodb find field based on variable"

3

mongodb find field based on variable

var name = req.params.name;
var value = req.params.value;
var query = {};
query[name] = value;
collection.findOne(query, function (err, item) { ... });
Posted by: Guest on May-25-2020

Code answers related to "mongodb find field based on variable"

Browse Popular Code Answers by Language