Mongovue Query Memo

Source: Internet
Author: User

Used for a period of time, mongovue some of the commonly used in the Mongovue of the query record, in order to consult.
1, and query
Query date equals 2016-01-08, and Page_url equals shouye.html
{"Date": "2016-01-08", "Page_url": "Shouye.html"}
2, $gte greater than or equal to, $gt greater than, $lte less than or equal to, $gt less than
The query date is greater than or equal to 2016-01-08 00:00:00, and is less than or equal to 2016-01-08 23:59:59, and the URL equals http://www.baidu.com
{
"datetime": {"$gte": "2016-01-08 00:00:00", "$lte": "2016-01-08 23:59:59"},
"url": "Http://www.baidu.com"
}
3, or query
Query date between 2015-12-03 and 2015-12-04 and Page_name contains "first", or Page_url contains "first"
{
"Date": {$gte: "2015-12-03", $lte: "2015-12-04"},
"$or": [{"Page_name": New RegExp ("First", ' G ')},{"Page_url": New RegExp ("First", ' G ')}]
}
4, in Query
Query Padcode equals 1000pekcz01001,1000pekcz01002 records
{
"Padcode": {
"$in": ["1000pekcz01001", "1000pekcz01002"]
}
}
5, Group Group query
To implement a group query for MongoDB, key (Group field), cond (grouping condition), Refuce (grouping method), initial (initial condition) are the values that the MongoDB packet query is not very small.
(a) Select the table you want to group, select "Collection--group", and turn on the grouping function.

(b) Enter the field to be grouped under key and enter the grouping filter under conditions. Open Reducetab page, in initial value out input "{" Count ": 0}", below the reduce function input:
function Reduce (doc, out) {
Out.count +=1
}
    
(iii) Finalize is the place where the results in reduce are processed again, and the default output is directly out.

(d) Select Go, which is the result of the group that pops up MongoDB.

    

Mongovue Query Memo

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.