downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

MongoCursor::__construct> <MongoCollection::validate
Last updated: Fri, 13 Nov 2009

view this page in

MongoCursor クラス

導入

データベースクエリの結果を表すオブジェクトです。

データベースへの実際の問い合わせは、next() あるいは hasNext() がコールされるまで行われません。問い合わせが行われる前に、 コマンドを次のように連ねることができます。

<?php
$cursor = $collection->find()->limit(10);

// まだデータベースへの問い合わせは行われていないので、検索オプションをさらに追加することができます
$cursor = $cursor->sort(array("a" => 1));

var_dump($cursor->getNext());
// ここでデータベースへの問い合わせが行われるので、これ以降はオプションを追加することはできません

// つまり、これは例外をスローします
$cursor->skip(4);
?>

クラス概要

MongoCursor
implements Iterator {
/* 静的フィールド */
static boolean $slaveOkay = FALSE ;
/* メソッド */
__construct ( resource $connection , string $ns [, array $query = array() [, array $fields = array() ]] )
public int count ( void )
public array current ( void )
public boolean dead ( void )
protected void doQuery ( void )
public array explain ( void )
public array getNext ( void )
public boolean hasNext ( void )
public MongoCursor hint ( array $key_pattern )
public string key ( void )
public MongoCursor limit ( int $num )
public void next ( void )
public void reset ( void )
public void rewind ( void )
public MongoCursor skip ( int $num )
public MongoCursor slaveOkay ([ boolean $okay = true ] )
public MongoCursor snapshot ( void )
public MongoCursor sort ( array $fields )
public MongoCursor tailable ([ boolean $tail = true ] )
public boolean valid ( void )
}

目次



add a note add a note User Contributed Notes
MongoCursor
There are no user contributed notes for this page.

MongoCursor::__construct> <MongoCollection::validate
Last updated: Fri, 13 Nov 2009
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites