PHP » GoLang |
login |
register |
about
|
GoLang MongoCollection::aggregateCursor
request it (350)
GoLang replacement for PHP's MongoCollection::aggregateCursor
[edit | history]
PHP MongoCollection::aggregateCursorPHP original manual for MongoCollection::aggregateCursor [ show | php.net ]MongoCollection::aggregateCursor(PECL mongo >=1.5.0) MongoCollection::aggregateCursor — Execute an aggregation pipeline command and retrieve results through a cursor DescriptionWith this method you can execute Aggregation Framework pipelines and retrieve the results through a cursor, instead of getting just one document back as you would with MongoCollection::aggregate(). This method returns a MongoCommandCursor object. This cursor object implements the Iterator interface just like the MongoCursor objects that are returned by the MongoCollection::find() method.
Parameters
Return ValuesReturns a MongoCommandCursor object. Because this implements the Iterator interface you can iterate over each of the results as returned by the command query. The MongoCommandCursor also implements the MongoCursorInterface interface which adds the MongoCommandCursor::batchSize(), MongoCommandCursor::dead(), MongoCommandCursor::info() methods. ExamplesExample #1 MongoCollection::aggregateCursor() example Finding all of the distinct values for a key.
<?php The above example will output something similar to: Molly: 130 Joe: 26 Sally: 22 Example #2 MongoCollection::aggregateCursor() example with different initial batch size Finding all of the distinct values for a key.
<?php The above example will output something similar to: Molly: 130 Joe: 26 Sally: 22 See Also
|
more
Recently updated
more
Most requested
|