From b21969b1f773e09c4985c4b6b4ff2555f6fdc917 Mon Sep 17 00:00:00 2001 From: Peter Cowburn Date: Mon, 7 Jul 2014 12:37:41 +0000 Subject: [PATCH] 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 --- reference/mongo/tutorial.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/mongo/tutorial.xml b/reference/mongo/tutorial.xml index 9511c852e0..e04be42e87 100644 --- a/reference/mongo/tutorial.xml +++ b/reference/mongo/tutorial.xml @@ -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 ?> ]]>