Open Source - mongoDB, nodeJS , PHP and mysql
Thursday, 3 April 2014
search a text in nested array dynamically in mongoDB nodeJs
db.collectionName.aggregate({"$unwind": "$rootColumn"}, {"$match": {"fieldToSearchOn": new RegExp(var)}}, {"$project": {"_id": 0, "fieldToSearchOn": 1}})
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment