MongoDB Aggregation Pipeline Optimization Language Collocations
Practise the standard verbs for optimizing MongoDB aggregation pipelines.
0 / 5 completed
1 / 5
Fill in: 'We ___ a $match stage as early as possible in the pipeline so later stages process a far smaller working set of documents.'
We 'place a stage' — the standard, established MongoDB collocation for positioning a pipeline stage for best performance. The other options aren't the recognised term here.
2 / 5
Fill in: 'Putting an expensive $lookup before a selective $match can ___ the pipeline joining far more documents than actually needed.'
We say the wrong stage order will 'cause' unnecessary joins — the standard collocation for the resulting inefficiency. The other options aren't idiomatic here.
3 / 5
Fill in: 'We ___ the pipeline with explain() in aggregate mode to see whether early stages are actually using an index.'
We 'run' explain — the standard, simple collocation for executing a diagnostic against a pipeline. The other options are less idiomatic here.
4 / 5
Fill in: 'We ___ a covering index on the fields used in an early $match and $sort so the pipeline avoids fetching whole documents.'
We 'create an index' — the standard, simple collocation for adding a new index to support a query pattern. The other options are less idiomatic here.
5 / 5
Fill in: 'We ___ document counts flowing through each stage so we can pinpoint exactly which stage is doing the most unnecessary work.'
We 'track' a count — the standard collocation for monitoring how a value changes through a process. The other options aren't idiomatic here.