| ユーザフォーラムで議論/質問 | マニュアル検索 | ハイライト | ハイライトオフ | ポータル | php spot |
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. 例例1 MongoCollection::aggregateCursor() example Finding all of the distinct values for a key.
<?php 上の例の出力は、 たとえば以下のようになります。 Molly: 130 Joe: 26 Sally: 22 例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 参考
|
各種マニュアル:
PHPマニュアル |
PEARマニュアル |
Smarty(英語)マニュアル |
PHP-GTKマニュアル |
「MongoCollection::aggregateCursor - Execute an aggregation pipeline command and retrieve results through a cursor」をGoogle検索
|