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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How is aggregation done in Mongoose?

A

ModelName.aggregate([])

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the input for the aggregate method in Mongoose?

A

An array of objects

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are some aggregation operations that are commonly used?

A

$match, $group, $addFields, $unwind, $project, $sort, $limit

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the format for an object in the aggregation array?

A

{$operation: val}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly