Basic
Aggregation Framework
db.collection.aggregate(pipeline, options)mydb.mycollection.aggregate([ {‘$match’ : {‘$text’ : {‘$search’ : ‘ value ’}}}, {‘$sort’ : SON([(‘ field ’, 1)])}, # from bson.sonimport SON {‘$project’ : {‘ field1 ’ : 1, ‘ field2 ’ : 1, ‘ field3 ’ : 0}} ])
Aggregate with geoNear
Last updated
Was this helpful?