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

Docs for SERVER-29912: $pop update modifier should validate that its argument is either 1 or -1

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.5.10
    • Component/s: Server
    • Labels:
      None

      Description

      Documentation Request Summary:

      We need to document this minor breaking change in the compatibility notes for 3.6. The title and description of this ticket should be self-explanatory but please reach out to me with any questions.

      Engineering Ticket Description:

      In 3.6.x versions, the argument to the $pop mode will be validated more strictly once the featureCompatibilityVersion is set to "3.6".

      Old behavior

      The past behavior was that any BSON element was allowed in place of elt below:

      db.collection.update({}, {$pop: {"array": <elt>}});
      

      If <elt> was numeric and less than zero, then the $pop would remove the first element of the array. On the other hand, if <elt> was any non-numeric type or was a number greater than or equal to zero, $pop would remove the last element of the array.

      New behavior

      $pop will now fail at parse time if elt is either a non-numeric type, or is a number which is not equal to 1 or -1. All numeric BSON types are allowed (NumberInt, NumberLong, NumberDouble, NumberDecimal), but if the number is not an exact representation of 1 or -1, then $pop will fail to parse.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              kay.kim Kay Kim (Inactive)
              Reporter:
              emily.hall Emily Hall
              Participants:
              Last commenter:
              Jonathan Dahl
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since reply:
                3 years, 13 weeks, 6 days ago
                Date of 1st Reply: