mongod操作问题。
发布于 9 年前 作者 xuzaixian 3338 次预览 最后一次回复是 9 年前 来自 分享
··· "_id": ObjectId(“50d3fdc6e4b024a11e8234c6”), “userId”: 280, “data”: [ { “name”: “test1”, “location”: “北京”, }, { “name”: “test1”, “location”: “北京 海淀区”, }, { “name”: “test3”, “location”: “河北 唐山”, } ] ··· 如果我想找到所有test:1的文档 就是结果如下所示,应该怎么做…第一次玩NOSQL玩不太转… ··· { “name”: “test1”, “location”: “北京”, }, { “name”: “test1”, “location”: “北京 海淀区”, } ···
2 回复
Message.getAll= function (name, callback) { // open db mongodb.open(function (err, db) { if (err) { return callback(err); }
}; Message接口名 messages数据库名 total数量