Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-55475

instock:{$slice:1} doesn't trigger the "inclusion"

    • Type: Icon: Question Question
    • Resolution: Works as Designed
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Querying
    • Query Execution 2021-05-31

      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 } ] }

            Assignee:
            irina.yatsenko@mongodb.com Irina Yatsenko (Inactive)
            Reporter:
            skydog.forstore@gmail.com kuku super
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: