-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: manual
-
Labels:None
Description
When using aggregation with $lookup using a pipeline stage:
We should add a note that $expr will only use indexes on the "from" collection for EQUALITY matches ONLY. In the example, it will only use an index on "warehouses.stock_item". It's unable to use it for the range component (warehouses.instock).
I bring this to your attention since it can have profound performance implications when using $lookup.