Lesson 4 MongoDB Data Query (1): mongodb Data Query

Source: Internet
Author: User

Lesson 4 MongoDB Data Query (1): mongodb Data Query
1. Course outlineThis course mainly describes MongoDB Data Query related content, including the introduction and use of the find function, query operator introduction and use, embedded document query, and array query. 1. Introduction and use of the find function 2. introduction and use of query operators 3. embedded document query and array Query
2. course IntroductionIn this lesson, we will first give a detailed introduction to the find function, and then explain several issues that need attention when using find. Finally, we will demonstrate the use of the find function. First, let's give a brief introduction to data query. MongoDB uses the find function for document query. Its function is the same as the select function in SQL, but it is different from the relational database's support for multi-Table connection query, the find function can operate only one set. MongoDB provides many query operators and many functions similar to those of relational databases, including ing, sorting, and limiting the number of returned results. In addition, it also provides operators for arrays, this is not available in relational databases. The find function is described in detail below. Db. set Name. the find (query, fields, limit, skip, batchSize, options) function has four parameters: the query parameter is a document type, it has the same meaning as the remove function and the first parameter of the update function introduced in the last lesson. It is used to specify the query conditions, which is equivalent to the where statement in SQL. The fileds parameter is used for field ing. By default, MongoDB returns all fields matching the document and sets the fields to be returned using the projecing (projection) to retrieve the subset of the document fields, it is equivalent to the field we need after SELECT in SQL. The limit parameter is used to limit the number of documents in the query result set. It is used to specify the upper limit, not the lower limit. If the number of documents in the result set is smaller than the limit, returns the entire result set. The skip parameter is used to skip a document that ignores a certain amount of data. It is used to set the offset of the first returned document. If the number of matched documents in the set is smaller than the number of skipped documents, the returned result is null, like the limit parameter, the skip parameter is also an integer. The Return Value of the find function is a cursor.3. Detailed course videoThe video course link is as follows: [MongoDB Data Query (1)]

Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

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.