Details
-
Task
-
Resolution: Fixed
-
Major - P3
-
None
Description
Description
The following changes to the projection language were made under this ticket:
1) In 4.2 the following projection:
{a: “foo”}
means "include a".
In 4.4 this means return a set to the string "foo".
Numbers (double/int/long/decimal) and booleans are still treated as markers for inclusion/exclusion.
2) Field ordering of find() projections using $elemMatch may not be the same between 4.2 and 4.4. See here in design doc:
https://docs.google.com/document/d/1K3KuAeYg5KuD1dKw4UvPLBite43_qv4wAd79rMwiJEQ/edit#bookmark=id.4iidgo563q21
3) $slice (in find()) no longer includes the entire root of a projected subfield
e.g. in 4.2, this query would include all of 'a':
[code]
db.c.find({}, {x: 1, "a.c": {$slice: 1}})
[code]
In 4.4, only 'a.c' will be included. This was arguably a bug.
4) Applying the positional projection to a path which had no arrays now behaves like an inclusion projection, rather than creating an empty document. See here in design document (and links to more detailed explanations):
https://docs.google.com/document/d/1K3KuAeYg5KuD1dKw4UvPLBite43_qv4wAd79rMwiJEQ/edit#bookmark=kix.kwu7hv9rfjc6
This will only affect queries that use positional projection ($) on non-array fields.
Description of Linked Ticket
Plug in the new execution code to the find() command. This should remove most uses of ProjectionExec from the query system.
Scope of changes
Impact to Other Docs
MVP (Work and Date)
Resources (Scope or Design Docs, Invision, etc.)
Attachments
Issue Links
- documents
-
SERVER-42423 Use ProjectionExecutor in ProjectionStageDefault
-
- Closed
-