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

search for in the

MongoCollection::findOne> <MongoCollection::ensureIndex
Last updated: Fri, 20 Nov 2009

view this page in

MongoCollection::find

(PECL mongo >=0.9.0)

MongoCollection::findQuerys this collection

Description

public MongoCursor MongoCollection::find ([ array $query = array() [, array $fields = array() ]] )

Parameters

query

The fields for which to search.

fields

Fields of the results to return.

Return Values

Returns a cursor for the search results.

Examples

Example #1 MongoCollection::find() example

This example demonstrates how to search for a range.

<?php

// search for documents where 5 < x < 20
$rangeQuery = array('x' => array( '$gt' => 5'$lt' => 20 ));

$cursor $collection->find($rangeQuery);

?>


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

MongoCollection::findOne> <MongoCollection::ensureIndex
Last updated: Fri, 20 Nov 2009
 
 
show source | credits | sitemap | contact | advertising | mirror sites