update : 2015.11.03
php.shukuma.com검색:
|
MongoCollection::aggregateCursor(PECL mongo >=1.5.0) MongoCollection::aggregateCursor — Execute an aggregation pipeline command and retrieve results through a cursor 설명With 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.
인수
반환값Returns 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. 예제Example #1 MongoCollection::aggregateCursor() example Finding all of the distinct values for a key.
<?php 위 예제의 출력 예시: 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 위 예제의 출력 예시: Molly: 130 Joe: 26 Sally: 22 참고
|