|
Setting Criteria for a QueryWe can create a query to pass to the MongoCollection::find method to get a subset of the documents in our collection. For example, if we wanted to find the document for which the value of the "i" field is 71, we would do the following:
<?php The above example will output: array(2) { ["_id"]=> object(MongoId)#6 (0) { } ["i"]=> int(71) ["_ns"]=> "testCollection" } |