Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-13321

Investigate changes in SERVER-42423: Use ProjectionExecutor in ProjectionStageDefault

    XMLWordPrintable

Details

    • Task
    • Status: Resolved
    • Major - P3
    • Resolution: Fixed
    • None
    • 4.3.1
    • manual
    • ServerDocs2020: Jun 1 -Jun5, ServerDocs2020: Jun8-Jun12, ServerDocs2020: Jun16-Jun19
    • true

    Description

      Description

      Downstream Change Summary

      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

          Activity

            People

              kay.kim@mongodb.com Kay Kim (Inactive)
              backlog-server-pm Backlog - Core Eng Program Management Team
              Githook User Githook User
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                2 years, 14 weeks, 5 days ago