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

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -