ποΈ π Using the Library Database
Select the library database
ποΈ π Empty Aggregation Pipeline
An empty aggregation
ποΈ π $match
The $match stage filters documents in a collection. It takes a document as input (your filter) and returns the documents that match the specified criteria. The syntax for the $match stage is as follows:
ποΈ π $project
Including fields in a projection
ποΈ π $limit
If we return too many documents but we're interested in only a few, we can limit the number of documents returned using $limit.
ποΈ π Combining stages
Up until now, we've just been using one stage in the pipeline. But the power of the aggregation pipeline is that we can use many stages, and the output of one will be the input of the next. Think of it as UNIX pipes or using functional programming with map, filter, reduce, flatmap, etc.
ποΈ π¦ΈββοΈ Writing Long Pipelines
Extra activity! Do it if you have extra time or are following along at home. It won't be covered during the hands-on lab.
ποΈ π¦ΈββοΈ Repeating Stages
Extra activity! Do it if you have extra time or are following along at home. It won't be covered during the hands-on lab.
ποΈ π¦ΈββοΈ Aggregation options
Extra activity! Do it if you have extra time or are following along at home. It won't be covered during the hands-on lab.