문제

I'd like to use full text search available in MongoDB 2.4. Text search is available through runCommand function e.g. db.collection.runCommand( "text", { search: "keywords"}). So, I'm wondering whether there is an equivalent to runCommand() function in mongojs or node-mongodb-native modules.

I know the question has been touched before but was never answered sufficiently. Thanks in advance.

도움이 되었습니까?

해결책 2

runCommand support has been added! https://github.com/gett/mongojs/issues/62

다른 팁

I found that as an equivalent:

collection.find({ $text: { $search : "your search words" }})
  .toArray(function(err,results) {
    // ..callback stuff..
});
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top