Make change streams oplog filter use an include list

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Major - P3
    • 8.3.0-rc0
    • Affects Version/s: None
    • Component/s: Change streams
    • None
    • Query Execution
    • Fully Compatible
    • QE 2026-03-02
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Previously, the change streams oplog match filter filtered on oplog entries with an exclusion filter for unwanted oplog entry types, e.g.

      {$nor: [

      {op: "c"}

      ,

      {op: "n"}

      ]}

      After some more oplog entry types were added recently, this filter grew to

      {$nor: [

      {op: "c"}

      ,

      {op: "n"}

      ,

      {op: "ci"}

      ,

      {op: "cd"}

      ,

      {op: "km"}

      ]}

      The purpose of these filters is to only match the CRUD oplog event types "d" (delete), "i" (insert) and "u" (update).
      It is more obvious and more efficient to create these filters as inclusion filters instead:

      {op: {$in: ["d", "i", "u"]}}

      This also has the advantage that the addition of new oplog entry types that should be excluded from change streams will not require the modification of the change stream oplog match filter. Only new oplog entry types that need to be handled in change streams will require a modification of the oplog match filter.

            Assignee:
            Jan Steemann
            Reporter:
            Jan Steemann
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: