In MongoDB C #/. NET Driver, IMongoQuery is used internally to implement Query,

Source: Internet
Author: User

[Switch] The internal implementation of IMongoQuery in MongoDB C #/. NET Driver,

MongoDB is a product between relational databases and non-relational databases. It has the most abundant functions and features like relational databases. The supported data structure is very loose and is similar to the json bjson format. Therefore, it can store complicated data types. The biggest feature of Mongo is that it supports a very powerful query language. Its syntax is a bit similar to an Object-Oriented Query Language, and almost can implement most of the functions of querying a single table similar to a relational database, it also supports data indexing.

Query. all ("name", "a", "B"); // matches the array Query with multiple elements. and (Query. EQ ("name", "a"), Query. EQ ("title", "t"); // multiple Query conditions are met at the same time. EQ ("name", "a"); // equals to Query. exists ("type", true); // determines whether the key value has a Query. GT ("value", 2); // greater than> Query. GTE ("value", 3); // greater than or equal to> = Query. in ("name", "a", "B"); // includes all specified values. You can specify different types of conditions and values. 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. If the remainder is equal to the second given value, the Query result is returned. NE ("name", "c"); // not equal to Query. nor (Array); // does not include the value Query in the Array. not ("name"); // element Condition Statement Query. notIn ("name", "a", 2); // returns a Query that does not match all the conditions in the array. or (Query. EQ ("name", "a"), Query. EQ ("title", "t"); // meets one of the Query conditions. size ("name", 2); // Query the length of the given key. type ("_ id", BsonType. objectId); // Query of the type of the given key. where (BsonJavaScript); // execute JavaScript Query. matches ("Title", str); // fuzzy query is equivalent to like -- str in SQL that can contain Regular Expressions

 

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.