MongoDB Deep Query

Source: Internet
Author: User

I do the project only data query, MongoDB database is other companies to store data and maintenance.

The pit daddy is the data I need is in the deep level of a record in MongoDB.

I need to take the nth value of BV in the BMV record of VL, according to the parameters.

A lot of data, if taken out, the subsequent data processing will greatly affect the efficiency.

MongoDB statement:

Find ({"BSN": "95614", "BMV. Vl. BV ": {" $exists ": true}," ct ": {" $gte ": 1419868800," $lte ": 1419955200}}, {" _id ": 0," CT ": 1," BMV. VL ": {" $slice ": [0, 1]}," BMV. Vl. BV ": {" $slice ": [4, 1]}})

Execution Result:

The following begins the explanation of the statement:

Find (query criteria, what to display);

"BMV. Vl. BV ": {" $exists ": True},//BMV below the VL field in the below is present, note: Just this field exists and is not guaranteed not to be empty oh;

"CT": {"$gte": 1419868800, "$lte": 1419955200}//$gte: Less than or equal, $GT: Less Than, $lt: greater Than, $lte: greater than or equal to;

"BMV. VL ": {" $slice ": [0, 1]}//displays the first record in the VL array below BMV;

"BMV. Vl. BV ": {" $slice ": [4, 1]}//Displays the 5th digit in the BV array;

feilds:{"$slice": [M, n]}//displays only n data in the Feilds array starting with M (excluding m).

MongoDB Deep Query

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.