📜  mongodb 根据变量查找字段 - 无论代码示例

📅  最后修改于: 2022-03-11 15:00:37.306000             🧑  作者: Mango

代码示例1
var name = req.params.name;
var value = req.params.value;
var query = {};
query[name] = value;
collection.findOne(query, function (err, item) { ... });