diff options
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"); |