-
Type: Task
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: manual
-
Labels:
Description
Downstream Change Summary
There were a number of small changes to the projection language made by this ticket:
1) Projecting on top-level dollar prefixed fields in find() is now banned, with a few exceptions ($sortKey, $recordId, for example) that are for internal use by mongos.
Example:
db.c.find({a: 1}, {$foobar: 1}) // Now illegal
2) Performing a projection on a field that also has the $slice expression applied to it is illegal.
Example:
db.c.find({}, {“comments”: {$slice: 1}, “comments.id”: 1}) // Illegal
3) $slice may not be used with positional projection on the same field.
Example:
db.c.find({"x.a": 1}, {"x.$": {$slice: -1}}) // Illegal
4) It is now illegal to project an empty field name
Description of Linked Ticket
null
Scope of changes
Impact to Other Docs
MVP (Work and Date)
Resources (Scope or Design Docs, Invision, etc.)
- documents
-
SERVER-42421 Plug in BSON -> ProjectionAST parser to find command path
- Closed