update : 2015.11.03
php.shukuma.com검색:
|
MongoCommandCursor::createFromDocument(PECL mongo >=1.5.0) MongoCommandCursor::createFromDocument — Create a new command cursor from an existing command response document 설명
public static MongoCommandCursor MongoCommandCursor::createFromDocument
( MongoClient
$connection
, string $hash
, array $document
)Use this method if you have a raw command result with cursor information in it. Note that cursors created with this method cannot be iterated multiple times, as they will lack the original command necessary for re-execution. 인수
반환값Returns the new cursor. 예제Example #1 MongoCommandCursor::createFromDocument()
<?php 위 예제의 출력 예시: array(2) { ["cursor"]=> array(3) { ["id"]=> object(MongoInt64)#5 (1) { ["value"]=> string(12) "392143983421" } ["ns"]=> string(11) "demo.cities" ["firstBatch"]=> array(1) { [0]=> array(2) { ["_id"]=> string(2) "AD" ["timezones"]=> array(1) { [0]=> string(14) "Europe/Andorra" } } } } ["ok"]=> float(1) } string(25) "localhost:27017;-;.;17617" As you can see, the returned cursor information has the id, ns and firstBatch fields. 참고
|