php封装的mongodb操作类代码
| /*     --------------------------------------------------------------------------------    SELECT FIELDS   --------------------------------------------------------------------------------      Determine which fields to include OR which to exclude during the query process.  Currently,including and excluding at the same time is not available,so the    $includes array will take precedence over the $excludes array. If you want to   only choose fields to exclude,leave $includes an empty array().      @usage: $this->mongo_db->select(array('foo','bar'))->get('foobar');  / /*     --------------------------------------------------------------------------------    WHERE PARAMETERS    --------------------------------------------------------------------------------      Get the documents based on these search parameters. The $wheres array should   be an associative array with the field as the key and the value as the search   criteria.     @usage = $this->mongo_db->where(array('foo' => 'bar'))->get('foobar');  */ /*     --------------------------------------------------------------------------------    WHERE_IN PARAMETERS  --------------------------------------------------------------------------------      Get the documents where the value of a $field is in a given $in array().      @usage = $this->mongo_db->where_in('foo',array('bar','zoo','blah'))->get('foobar'); */ /*     --------------------------------------------------------------------------------    WHERE_NOT_IN PARAMETERS  --------------------------------------------------------------------------------      Get the documents where the value of a $field is not in a given $in array().      @usage = $this->mongo_db->where_not_in('foo','blah'))->get('foobar'); */ /*     --------------------------------------------------------------------------------    WHERE GREATER THAN PARAMETERS   --------------------------------------------------------------------------------      Get the documents where the value of a $field is greater than $x      @usage = $this->mongo_db->where_gt('foo',20);   */ /*     --------------------------------------------------------------------------------    WHERE GREATER THAN OR EQUAL TO PARAMETERS   --------------------------------------------------------------------------------      Get the documents where the value of a $field is greater than or equal to $x      @usage = $this->mongo_db->where_gte('foo',20);  */ /*     --------------------------------------------------------------------------------    WHERE LESS THAN PARAMETERS   --------------------------------------------------------------------------------      Get the documents where the value of a $field is less than $x     @usage = $this->mongo_db->where_lt('foo',20);   */ (编辑:源码网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! | 

