mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Fix collection variable name in examples
Patch by Greg Bowler git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@334177 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
d384c3f8e2
commit
b21969b1f7
1 changed files with 4 additions and 4 deletions
|
@ -485,7 +485,7 @@ $connection = new MongoClient();
|
|||
$collection = $connection->database->collectionName;
|
||||
|
||||
$query = array( "i" => array( '$gt' => 50 ) ); //note the single quotes around '$gt'
|
||||
$cursor = $coll->find( $query );
|
||||
$cursor = $collection->find( $query );
|
||||
|
||||
while ( $cursor->hasNext() )
|
||||
{
|
||||
|
@ -506,7 +506,7 @@ $connection = new MongoClient();
|
|||
$collection = $connection->database->collectionName;
|
||||
|
||||
$query = array( 'i' => array( '$gt' => 20, "\$lte" => 30 ) );
|
||||
$cursor = $coll->find( $query );
|
||||
$cursor = $collection->find( $query );
|
||||
|
||||
while ( $cursor->hasNext() )
|
||||
{
|
||||
|
@ -536,8 +536,8 @@ while ( $cursor->hasNext() )
|
|||
$connection = new MongoClient();
|
||||
$collection = $connection->database->collectionName;
|
||||
|
||||
$coll->ensureIndex( array( "i" => 1 ) ); // create index on "i"
|
||||
$coll->ensureIndex( array( "i" => -1, "j" => 1 ) ); // index on "i" descending, "j" ascending
|
||||
$collection->ensureIndex( array( "i" => 1 ) ); // create index on "i"
|
||||
$collection->ensureIndex( array( "i" => -1, "j" => 1 ) ); // index on "i" descending, "j" ascending
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
|
|
Loading…
Reference in a new issue