1:34 Pro
An aggregation, built and charted
Every stage answered before the next one is written.
Recorded on Monghoul 2.0.0-rc.1. No sound.
What happens
Four stages added to the aggregation builder one at a time, each answered by its own Run to here: a $match, then a $lookup filled in by choosing the collection and the two fields to join on, then an $unwind whose preview opens to show the whole joined customer sitting inside an order, then a $group; the result is read as a bar chart of revenue by customer tier.
Chapters
- 0:00 Open orders
- 0:03 Switch to the builder
- 0:06 More room to build in
- 0:10 $match: only the orders that count
- 0:21 $lookup: bring the customer in
- 0:35 $unwind: one row per customer
- 0:45 Open one of them
- 0:48 And the whole customer came with it
- 0:53 $group: revenue by customer tier
- 1:10 Run the whole pipeline
- 1:13 Drag the result open
- 1:17 Read it as a chart instead
- 1:19 Category breakdown
- 1:28 The chart