PHPマニュアル/PEARマニュアル | ユーザフォーラムで議論/質問 | マニュアル検索 | ハイライト | ハイライトオフ | ポータル | php spot

MongoCollection::parallelCollectionScan - Returns an array of cursors to iterator over a full collection in parallel | JavaScript入門&応用&リファレンスなら「JavaScriptist」

  

MongoCollection::parallelCollectionScan

(PECL mongo >=1.5.0)

MongoCollection::parallelCollectionScanReturns an array of cursors to iterator over a full collection in parallel

説明

public array[MongoCommandCursor] MongoCollection::parallelCollectionScan ( int $num_cursors )

This method returns an array of a maximum of num_cursors cursors. An iteration over one of the returned cursors results in a partial set of documents for a collection. Iteration over all the returned cursors results in getting every document back from the collection.

This method is a wrapper for the parallelCollectionScan MongoDB command.

パラメータ

num_cursors

The number of cursors to request from the server. Please note, that the server can return less cursors than you requested.

返り値

Returns an array of MongoCommandCursor objects.

例1 MongoCollection::parallelCollectionScan() example

Returning all documents in a collection by using multiple cursors.

<?php
$m 
= new MongoClient;
$c $m->demo->cities;

/* Request three cursors */
$cursors $c->parallelCollectionScan);

/* Add all the cursors to the MultipleIterator */
$mi = new MultipleIteratorMultipleIterator::MIT_NEED_ANY );
foreach ( 
$cursors as $cursor )
{
    
$mi->attachIterator$cursor );
}

/* Iterate over all the associated cursors */
foreach ( $mi as $items )
{
    foreach ( 
$items as $item )
    {
        if ( 
$item !== NULL )
        {
            echo 
$item['name'], "\n";
        }
    }
}
?>

参考


忘却曲線を使ってこの知識を確実に記憶に残す

フォーラムで「MongoCollection::parallelCollectionScan - Returns an array of cursors to iterator over a full collection in parallel」について話す
各種マニュアル: PHPマニュアル | PEARマニュアル | Smarty(英語)マニュアル | PHP-GTKマニュアル | MongoCollection::parallelCollectionScan - Returns an array of cursors to iterator over a full collection in parallel」をGoogle検索
copyright © 1997-2024 PHP ドキュメント作成グループ(ライセンス). provided by php spot. マニュアル: