相当于Node.js中的mongo shell db.collection.runCommand()
我想在MongoDB 2.4中使用全文search。 文本search可通过runCommand函数获得,例如db.collection.runCommand( "text", { search: "keywords"})
。 所以,我想知道在mongojs或者node-mongodb-native模块中是否有相当于runCommand()函数。
我知道这个问题以前曾经触及过,但从来没有得到足够的回答。 提前致谢。
我发现,作为一个等价物:
collection.find({ $text: { $search : "your search words" }}) .toArray(function(err,results) { // ..callback stuff.. });
runCommand支持已被添加! https://github.com/gett/mongojs/issues/62