Project 2
Simple Queries to perform on ecommerce db
A1.
db.products.aggregate([{$group:{_id:'product_cost',
avg:{$avg:'$product_cost'}}}])
A2.
db.customers.aggregate([{$sort: {purchase_amount:-1}])
A3.
db.order.aggregate([{$group:{_id:'Total_cost', sum:
{$sum:'$product_cost'}}}])
A4.
db.customers.aggregate([{$group:{_id:'customer_city',
$match:{customer_city}}}])
A5.
db.sellers.aggregate([$group:{_id:'seller_name',
$match: {customer_city}}}])
db.orders.aggregate([$sort :{order: 1}, $match:
{customer_city}}}])