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

Prohibit establishing a $changeStream cursor on a read-only view

    XMLWordPrintable

    Details

    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v3.6
    • Epic Link:
    • Sprint:
      Repl 2017-11-13, Repl 2017-12-04

      Description

      The server currently allows something like the following:

      db.c.drop();
      db.v.drop();
      db.c.insert({});
      db.createView("v", "c", []);
      db.v.aggregate([{$changeStream: {}}]);
      

      However, there is no machinery to produce notifications for changes to a view that occur based on writes to the view's backing collections. As such, notifications will never be delivered to the client for changes to views. Since this use case is not supported, the server should return a clear error message when a user attempts to establish a $changeStream cursor on a view. The current behavior is to establish a $changeStream cursor that will never return any results.

        Attachments

          Activity

            People

            Assignee:
            siyuan.zhou Siyuan Zhou
            Reporter:
            david.storch David Storch
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: