robbiblubber.org

help | login | search:  
>>

show wiki  show source  compare to current  compare to previous  read  history 


aggregate()


MongoDB Driver Function Reference


Retrieves an aggregation from a collection.



db.<collection>.aggregate([<pipeline>[, <options>]])



Arguments


<collection> The target collection
<pipeline> An array of BSON documents specifying the aggregation pipline
<options> A BOSN document specifying options



Options


{ allowDiskUse: <boolean>, batchSize: <int>, comment: <string>, maxAwaitTime: <long>,
collation: <document>, hint: <document>, bypass }

allowDiskUse Allows to write to disk while executing
batchSize Sets the batch size.
comment Sets the comment.
maxAwaitTime Sets the maximum await time (in milliseconds).
collation A document specifying the collation
hint A document specifying a hint



Return Value


Returns a result set (cursor).



Example


db.employees.aggregate([{ $match: {salary: { $gt: 1000000 }}}]);


Returns the aggregated documents.




home | MongoDB Driver Function Reference | MongoDB Driver