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

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

    XMLWordPrintableJSON

Details

    • Icon: Question Question
    • Resolution: Works as Designed
    • Icon: Minor - P4 Minor - P4
    • None
    • None
    • Querying
    • Query Execution 2021-05-31

    Description

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

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: