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:
Peter Cowburn 2014-07-07 12:37:41 +00:00
parent d384c3f8e2
commit b21969b1f7

View file

@ -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>