node.js - How to use aggregation framework to search text with nodejs -
as mentioned in release notes of mongodb 2.6, can text search in aggregation framework. can in shell
db.products.aggregate([{ $match: { $text: { $search: 'keyword' } } }]);
everything works alright here. want same thing nodejs with:
var aggrconditions = [{ $match: { $text: { $search: 'keyword' } } }]; db.collection(product_coll_name).aggregate(aggrconditions, function(err, result) { if (err) throw err; // });
it complains about:
exception: invalid operator: $search
i'm using node native client 1.4.5. i'm doing wrong?
Comments
Post a Comment