summaryrefslogtreecommitdiff
path: root/jstests/noPassthrough/change_stream_preimages_fail_on_mongos.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/noPassthrough/change_stream_preimages_fail_on_mongos.js')
-rw-r--r--jstests/noPassthrough/change_stream_preimages_fail_on_mongos.js48
1 files changed, 0 insertions, 48 deletions
diff --git a/jstests/noPassthrough/change_stream_preimages_fail_on_mongos.js b/jstests/noPassthrough/change_stream_preimages_fail_on_mongos.js
deleted file mode 100644
index dd871885c6c..00000000000
--- a/jstests/noPassthrough/change_stream_preimages_fail_on_mongos.js
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- * Test that mongoS rejects change streams which request 'fullDocumentBeforeChange' pre-images.
- *
- * @tags: [uses_change_streams, requires_replication]
- */
-(function() {
-'use strict';
-
-load("jstests/libs/change_stream_util.js"); // For isChangeStreamPreAndPostImagesEnabled.
-
-const st = new ShardingTest({
- shards: 1,
- mongos: 1,
- config: 1,
-});
-
-const shard = st.shard0;
-const mongos = st.s;
-
-if (isChangeStreamPreAndPostImagesEnabled(mongos.getDB("test"))) {
- jsTestLog(
- "Skipping test as pre-image lookup is supported in sharded clusters with feature flag " +
- "'featureFlagChangeStreamPreAndPostImages' enabled.");
- st.stop();
- return;
-}
-
-// Test that we cannot create a collection with pre-images enabled in a sharded cluster.
-assert.commandFailed(shard.getDB("test").runCommand({create: "test", recordPreImages: true}));
-
-// Test that attempting to run $changeStream with {fullDocumentBeforeChange: "whenAvailable"} fails.
-assert.commandFailedWithCode(mongos.getDB("test").runCommand({
- aggregate: 1,
- pipeline: [{$changeStream: {fullDocumentBeforeChange: "whenAvailable"}}],
- cursor: {}
-}),
- 51771);
-
-// Test that attempting to run $changeStream with {fullDocumentBeforeChange: "required"} fails.
-assert.commandFailedWithCode(mongos.getDB("test").runCommand({
- aggregate: 1,
- pipeline: [{$changeStream: {fullDocumentBeforeChange: "required"}}],
- cursor: {}
-}),
- 51771);
-
-st.stop();
-}());