Agregation Pipeline Flashcards
1
Q
What is the aggregation pipeline?
A
It is a set of operations that every document is subject to during a query
2
Q
How is aggregation done in Mongoose?
A
ModelName.aggregate([])
3
Q
What is the input for the aggregate method in Mongoose?
A
An array of objects
4
Q
What are some aggregation operations that are commonly used?
A
$match, $group, $addFields, $unwind, $project, $sort, $limit
5
Q
What is the format for an object in the aggregation array?
A
{$operation: val}