Mongodb Query queries

Source: Internet
Author: User
Tags mongodb query

Query.all ("name", "a", "B");//match array with multiple elements
Query.and (Query.eq ("name", "a"), Query.eq ("title", "T"));//satisfy multiple conditions at the same time
Query.eq ("name", "a");//equals
Query.exists ("type", true);//Determine if key value exists
QUERY.GT ("value", 2);//Greater Than >
Query.gte ("Value", 3);//greater than or equal to >=
Query.in ("name", "a", "B");//Includes all values specified, you can specify different types of conditions and values
query.lt ("value", 9);//Less than <
Query.lte ("value", 8);//less than or equal to <=
Query.mod ("Value", 3, 1);//Divide the query value by the first given value and return the result if the remainder equals the second given value
Query.ne ("name", "C");//Not equal to
Query.nor (array);//do not include values in the array
Query.not ("name");//Element conditional statement
Query.notin ("name", "a", 2);//Returns a document that does not match all the conditions in the array
Query.or (Query.eq ("name", "a"), Query.eq ("title", "T"));//satisfies one of the conditions
Query.size ("name", 2);//The length of the given key
Query.type ("_id", bsontype.objectid);//The type of the given key
Query.where (bsonjavascript);//execute JavaScript
Query.matches ("Title", str);//fuzzy query equivalent to SQL in like--STR can contain regular expressions

Mongodb Query queries

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.