-
Type: Improvement
-
Resolution: Won't Fix
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Optimization
This arose from SERVER-83756:
- Currently, $meta is legal in exclusion projections. E.g., the following is a legal pipeline:
[{ $project: {"about" : 0, "score": { "$meta": "textScore" }}}]
Other than id, $meta is the _only exception to the "don't mix inclusion and exclusion projections" rule.
For more explanation & documentation on how this is currently problematic in the code, see first two sections of: https://docs.google.com/document/d/1IrjexstlwIYkoWEmwpHZOLz64ad5R4MdU3dVwpV-17c/edit?usp=sharing
- Currently, $meta in find is parsed by default as exclusion. E.g., the following is parsed as an exclusion projection:
{foo: {$meta: 'sortKey'}}
The default behavior for some $func expression is to parse it as an inclusion projection.
Began work on this as part of SERVER-83756, but ended up resolving it with a workaround as it became clear that these changes would be significant.
As a starting point, documentation of initial work that was done: https://docs.google.com/document/d/1fN026Wo_LI0lrwylj1JJ1wN7pWIujUj0rj9kPU8AqKY/edit?usp=sharing
- is related to
-
SERVER-83756 [$vectorSearch, $project, $match] not passing documents when match depends on meta field from project
- Closed
- related to
-
SERVER-86697 Complete TODO listed in SERVER-86431
- Open