markdown 有意思:Mongo Drils

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown 有意思:Mongo Drils相关的知识,希望对你有一定的参考价值。

* Build a query to filter the data set.  Find all of the restaurants which have:
    * The cuisine set to something other than "Not Listed/Not Applicable"
    * The borough set to something other than "Missing"
    * At least one grade
    * None of the grades set to "Not Yet Graded"
    * None of the scores  set to -1
    
```js
db.restaurants.count(
cusisine: {$ne: "Not Listed/Not Applicable"},
borough: {$ne: "Missing"},
$where: "this.grades.length >0",
grades: {$ne: "Not Yet Graded"},
"grades.score": {$gte: 0}
)
```

* How many restaurants were filtered out? 
**2**
* Ignoring your filter (i.e. querying all of the restaurants):
   * Create a list of all of the cuisines offered by the restaurants, with no duplicates
   * Find the first five restaurants with the lowest positive score in one of their gradings.
   * Find the restaurants which have only been graded A.



以上是关于markdown 有意思:Mongo Drils的主要内容,如果未能解决你的问题,请参考以下文章

markdown Mongo常用语句

markdown 挑战11:Mongo基础知识

markdown Mongo命令

markdown Mongo备忘单

markdown Mongo备忘单

markdown OS X上的mongo自动启动