MongoDB
This commit is contained in:
4
todo3.md
4
todo3.md
@@ -38,13 +38,13 @@ db.restaurants.find();
|
||||
db.restaurants.find({},{restaurant_id:1, name:1, borough:1, cuisine:1});
|
||||
```
|
||||
|
||||
### Q4 Afficher les 5 premiers documents de la collection restaurants. Utiliser la projection de Q3
|
||||
4. Afficher les 5 premiers documents de la collection restaurants. Utiliser la projection de Q3
|
||||
|
||||
```javascript
|
||||
db.restaurants.find({},{restaurant_id:1, name:1, borough:1, cuisine:1})().limit(5);
|
||||
```
|
||||
|
||||
### Q5 Afficher la liste des boroughs
|
||||
5. Afficher la liste des quartiers (boroughs)
|
||||
|
||||
```javascript
|
||||
db.restaurants.distinct("borough")
|
||||
|
||||
Reference in New Issue
Block a user