Challenge

Project 2

Ans1.
db.products.aggregate([{$group:{_id:'product_cost',

avg:{$avg:'$product_cost'}}}])

Ans2.
db.customers.aggregate([{$sort: {purchase_amount:-1}])

Ans3.
db.order.aggregate([{$group:{_id:'Total_cost', sum:

{$sum:'$product_cost'}}}])

Ans4.
db.customers.aggregate([{$group:{_id:'customer_city',

$match:{customer_city}}}])

Ans5.

db.sellers.aggregate([$group:{_id:'seller_name',

$match: {customer_city}}}])

db.orders.aggregate([$sort :{order: 1}, $match:

{customer_city}}}])

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.