Skip to content
Snippets Groups Projects
Commit 3133c88e authored by christop.frachebo's avatar christop.frachebo
Browse files

Modification dernières requêtes

parent e13e39d2
No related branches found
No related tags found
No related merge requests found
...@@ -144,5 +144,5 @@ db.orders.aggregate([{$group : {_id :{"id":"$customer.id", "pseudo":"$customer.p ...@@ -144,5 +144,5 @@ db.orders.aggregate([{$group : {_id :{"id":"$customer.id", "pseudo":"$customer.p
### requête 7 ### requête 7
```js ```js
db.orders.aggregate([{$unwind:"$items" }, {$group:{_id:"$items.vendor", "total":{$sum: {$multiply: ["$items.finalprice", "$items.qty"]}}}}]) db.orders.aggregate([{$unwind:"$items" }, {$group:{_id:"$items.vendor", "total":{$sum: "$items.finalprice"}}}])
``` ```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment