Common PHP MongoDB query operations

Source: Internet
Author: User
Tags mongodb query php mongodb
<? PHP  //  The delimiter string is  $ Querys = Array ("Name" => "Shian" );  //  Number of equal values  $ Querys = Array ("Number" => 7 );  //  What is the value greater  $ Querys = Array ("Number" => Array ('$ GT' => 5 ));  //  The number is greater  $ Querys = Array ("Number" => Array ('$ Gte' => 2 ));  //  The number is smaller  $ Querys = Array ("Number" => Array ('$ Lt' => 5 )); //  The number is less  $ Querys = Array ("Number" => Array ('$ LTE' => 2 ));  //  Data Value  $ Querys = Array ("Number" => Array ('$ GT' => 1, '$ lt' => 9 ));  //  The value is not equal to a value. $ Querys = Array ("Number" => Array ('$ Ne' => 9 ));  //  Use js to check the condition  $ JS =" Function () {return this. Number = 2 & this. Name = 'shian ';} " ;  $ Querys = Array ('$ Where' => $ JS  );  // Value of the given bitwise  $ Querys = Array ("Number" => Array ('$ In' => Array (1, 2, 9 )));  //  Which values are not equal to the given value?  $ Querys = Array ("Number" => Array ('$ Nin' => Array (1, 2, 9 )));  // Use the regular query statement  $ Querys = Array ("Name" => New Mongoregex ("/Shi/ $ I " ));  //  Or  $ Querys = Array ('$ Or' => Array ( Array ('Number' => 2 ), Array ('Number' => 9 ))); ?>
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.