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

Use compact diff format for updates to arrays using classic $addToSet operator

    • Query Execution
    • Fully Compatible
    • QE 2023-05-15, QE 2023-05-29, QE 2023-06-12, QE 2023-06-26, QE 2023-07-10, QE 2023-07-24, QE 2023-08-07, QE 2023-08-21

      When we use $addToSet to add an element to the array, the entire new array is recorded in the oplog. This leads to large change stream events.

      Today $addToSet does not guarantee a particular ordering of elements in the modified set, so it could be modified to always add the element to the end of the array, similar to $push, and produce message like { 'arrayField.100': 'value'  }

            Assignee:
            mickey.winters@mongodb.com Mickey Winters
            Reporter:
            kateryna.kamenieva@mongodb.com Katya Kamenieva
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: