diff options
author | Bernard Gorman <bernard.gorman@gmail.com> | 2018-04-05 19:52:33 +0100 |
---|---|---|
committer | Bernard Gorman <bernard.gorman@gmail.com> | 2018-04-12 03:08:55 +0100 |
commit | d5fb9cf6f4a26ebdc6d01e24ae73f29c29703b3c (patch) | |
tree | 4b8ab5f162268f6821a41b65175a191eb49c97c1 /jstests/change_streams/change_stream.js | |
parent | b299eabdf833eb85c2f205c847d6fc38910aefb1 (diff) | |
download | mongo-d5fb9cf6f4a26ebdc6d01e24ae73f29c29703b3c.tar.gz |
SERVER-34086 Add ability to watch all changes for an entire replica set
Diffstat (limited to 'jstests/change_streams/change_stream.js')
-rw-r--r-- | jstests/change_streams/change_stream.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/jstests/change_streams/change_stream.js b/jstests/change_streams/change_stream.js index e7520d974b2..01d60bde295 100644 --- a/jstests/change_streams/change_stream.js +++ b/jstests/change_streams/change_stream.js @@ -19,6 +19,16 @@ assertInvalidChangeStreamNss("local"); } + // Test that a change stream can be opened on the admin database if {allChangesForCluster:true} + // is specified. + assertValidChangeStreamNss("admin", 1, {allChangesForCluster: true}); + // Test that a change stream cannot be opened on the admin database if a collection is + // specified, even with {allChangesForCluster:true}. + assertInvalidChangeStreamNss("admin", "testcoll", {allChangesForCluster: true}); + // Test that a change stream cannot be opened on a database other than admin if + // {allChangesForCluster:true} is specified. + assertInvalidChangeStreamNss(db.getName(), 1, {allChangesForCluster: true}); + // Test that a change stream cannot be opened on 'system.' collections. assertInvalidChangeStreamNss(db.getName(), "system.users"); assertInvalidChangeStreamNss(db.getName(), "system.profile"); |