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

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

    • Fully Compatible
    • ALL
    • v3.6
    • Repl 2017-11-13, Repl 2017-12-04

      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.

            Assignee:
            siyuan.zhou@mongodb.com Siyuan Zhou
            Reporter:
            david.storch@mongodb.com David Storch
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: