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

Investigate changes in SERVER-55475: instock:{$slice:1} doesn't trigger the "inclusion"

    XMLWordPrintableJSON

Details

    Description

      Description

      Downstream Change Summary

      The semantics of $slice is updated to be consistent with other projection operators. Now specifying $slice in projection for a field will trigger an implicit inclusion.

      Description of Linked Ticket

      https://docs.mongodb.com/manual/tutorial/project-fields-from-query-results/

       

      db.inventory.find({"item":"postcard"}, {_id:0, instock:{$slice:1}})
      

      returned

      { "item" : "postcard", "status" : "A", "size" : { "h" : 10, "w" : 15.25, "uom" : "cm" }, "instock" : [ { "warehouse" : "B", "qty" : 15 } ] }
      

      it was expected to return

      {"instock" : [ { "warehouse" : "B", "qty" : 15 } ] }

      Scope of changes

      Impact to Other Docs

      MVP (Work and Date)

      Resources (Scope or Design Docs, Invision, etc.)

      Attachments

        Activity

          People

            Unassigned Unassigned
            backlog-server-pm Backlog - Core Eng Program Management Team
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              1 year, 14 weeks, 2 days ago