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