���ǿ����ò�ѯ�����Ӽ����л�ö���ĵ��� ���磺��Ҫ��� "i" > 50 ���ĵ���������Ҫ��
<?php
$connection = new MongoClient();
$collection = $connection->database->collectionName;
$query = array( "i" => array( '$gt' => 50 ) ); //note the single quotes around '$gt'
$cursor = $collection->find( $query );
while ( $cursor->hasNext() )
{
var_dump( $cursor->getNext() );
}
?>
������ʾ "i" > 50 ���ĵ���Ҳ���Ի��һ����Χ�ڵ��ĵ������� 20 < i <= 30��
<?php $connection = new MongoClient(); $collection = $connection->database->collectionName; $query = array( 'i' => array( '$gt' => 20, "\$lte" => 30 ) ); $cursor = $collection->find( $query ); while ( $cursor->hasNext() ) { var_dump( $cursor->getNext() ); } ?>
Ҫע����Ԫ�ַ�ʼ�ն���Ҫת�壬���߿����õ����Ŵ��档���� PHP ����������ɶ�Ӧ�ı��� $gt��