Tsallaka zuwa abun ciki
Justice Tech School

Project: Sales Report

Group orders by customer.

Example
db.orders.aggregate([
  { $match: { status: "paid" } },
  { $group: { _id: "$customer", spent: { $sum: "$amount" } } },
  { $sort: { spent: -1 } },
  { $limit: 3 }
])

Exercise

Top three.

{ $limit:  }

Quiz Test

What does the report return?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.