$slice operator- skipping n elements from the end of an array where n > than array length doesn't return null values

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Querying
    • Query
    • ALL
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Consider the document:
      {_id: 1, a : [1,2,3,4,5]}

      db.collection.find({}, {a : {$slice : [-10, 1]}}) returns
      {_id : 1, a : [1]}

      whereas
      db.collection.find({}, {a : {$slice : [10, 1]}}) returns
      {_id : 1, a : []}

            Assignee:
            Backlog - Query Team (Inactive)
            Reporter:
            Jenna deBoisblanc (Inactive)
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: