mongodbmongodb-3.6changestreammongodb4.0

Can MongoDB changeStreams listen to system level collections?


With the limited documentation available on MongoDB changestreams which they introduced version 3.6 onwards, I am not able to conclude if MongoDB changestreams let us listen to system collection changes.

Currently, I am interested in system.profile collection.


Solution

  • As of MongoDB v4.0, you can’t open a change stream on internal database.system.profile collection.

    The collection is reserved for internal use and is not included in the replica set oplog, and because changestreams rely on the oplog it won’t be able to broadcast the change events.