Posted in PHP onJune 20, 2013
<?php // ?谖蛔执??BR>$querys = array("name"=>"shian");// ?抵档褥抖嗌?BR>$querys = array("number"=>7); // ?抵荡箪抖嗌?BR>$querys = array("number"=>array('$gt' => 5)); // ?抵荡箪兜褥抖嗌?BR>$querys = array("number"=>array('$gte' => 2)); // ?抵敌§抖嗌?BR>$querys = array("number"=>array('$lt' => 5)); // ?抵敌§兜褥抖嗌?BR>$querys = array("number"=>array('$lte' => 2)); // ?抵到殪抖嗌?BR>$querys = array("number"=>array('$gt' => 1,'$lt' => 9)); // ?抵挡坏褥赌持?BR>$querys = array("number"=>array('$ne' => 9)); // 使用js下查??l件 $js = "function(){ return this.number == 2 && this.name == 'shian'; }"; $querys = array('$where'=>$js); // ?谖坏褥赌男┲?BR>$querys = array("number"=>array('$in' => array(1,2,9))); // ?谖徊坏褥赌男┲?BR>$querys = array("number"=>array('$nin' => array(1,2,9))); // 使用正?查? $querys = array("name" => new MongoRegex("/shi/$i")); // 或 $querys = array('$or' => array(array('number'=>2),array('number'=>9))); ?>
解析PHP中常见的mongodb查询操作
声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Reply on: @reply_date@
@reply_contents@