php封装的mongodb操作类代码
/* -------------------------------------------------------------------------------- WHERE BETWEEN PARAMETERS -------------------------------------------------------------------------------- Get the documents where the value of a $field is between $x and $y @usage = $this->mongo_db->where_between('foo',20,30); */ /* -------------------------------------------------------------------------------- WHERE BETWEEN AND NOT EQUAL TO PARAMETERS -------------------------------------------------------------------------------- Get the documents where the value of a $field is between but not equal to $x and $y @usage = $this->mongo_db->where_between_ne('foo',30); */ /* -------------------------------------------------------------------------------- WHERE NOT EQUAL TO PARAMETERS -------------------------------------------------------------------------------- Get the documents where the value of a $field is not equal to $x @usage = $this->mongo_db->where_between('foo',30); */ /* -------------------------------------------------------------------------------- WHERE OR -------------------------------------------------------------------------------- Get the documents where the value of a $field is in one or more values @usage = $this->mongo_db->where_or('foo',array( 'foo','bar','blegh' ); */ /* -------------------------------------------------------------------------------- WHERE AND -------------------------------------------------------------------------------- Get the documents where the elements match the specified values @usage = $this->mongo_db->where_and( array ( 'foo' => 1,'b' => 'someexample' ); */ /* -------------------------------------------------------------------------------- WHERE MOD -------------------------------------------------------------------------------- Get the documents where $field % $mod = $result @usage = $this->mongo_db->where_mod( 'foo',10,1 ); */ /* -------------------------------------------------------------------------------- Where size -------------------------------------------------------------------------------- Get the documents where the size of a field is in a given $size int @usage : $this->mongo_db->where_size('foo',1)->get('foobar'); */ /* -------------------------------------------------------------------------------- LIKE PARAMETERS -------------------------------------------------------------------------------- Get the documents where the (string) value of a $field is like a value. The defaults allow for a case-insensitive search. @param $flags Allows for the typical regular expression flags: i = case insensitive m = multiline x = can contain comments l = locale s = dotall,"." matches everything,including newlines u = match unicode @param $enable_start_wildcard If set to anything other than TRUE,a starting line character "^" will be prepended to the search value,representing only searching for a value at the start of a new line. @param $enable_end_wildcard If set to anything other than TRUE,an ending line character "$" will be appended to the search value,representing only searching for a value at the end of a line. @usage = $this->mongo_db->like('foo','im',FALSE,TRUE); */ public function wheres($where){ (编辑:晋中站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |