-
Type: Task
-
Resolution: Won't Fix
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Server
-
Labels:None
Documentation Request Summary:
Changestreams can now report all operations from all collections in all databases in a replica set, with the exception of internal databases (admin, config and local) and internal collections within user databases, i.e. those collections whose names are of the form system.*
A cluster-wide change stream is opened by issuing an aggregation command on the 'admin' database in the following form:
adminDB.runCommand({aggregate: 1, pipeline: [{$changeStream: {allChangesForCluster: true}}], cursor: {}})
The command must be run on the admin db, the value of the "aggregate" field must be 1, and the 'allChangesForCluster' parameter must be true. Attempting to run an aggregation on the 'admin' db with a collection name or with 'allChangesForCluster: false' will return an error to the client, as will using 'allChangesForCluster' on a database other than admin.
Engineering Ticket Description:
Changes to the "admin", "config", and "local" databases will be excluded, along with any changes to system collections.
Proposed Syntax
db.adminCommand({
aggregate: 1,
pipeline: [
{$changeStream: {allChangesForCluster: true, ...}},
...
],
...
});
- documents
-
SERVER-34086 Add ability to watch all changes for an entire replica set
- Closed
- related to
-
DOCS-11596 Docs for SERVER-34087: Add db.getMongo().watch() helper to watch all changes for the cluster
- Closed