summaryrefslogtreecommitdiff
path: root/jstests
diff options
context:
space:
mode:
authorGregory Wlodarek <gregory.wlodarek@mongodb.com>2022-03-07 20:44:36 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-03-07 21:27:11 +0000
commitb6f2129ad1c00c474586625efaa8880fb8eac331 (patch)
treee50a1ab44461cf06d74c8d172b6cfe6cc97bffaa /jstests
parenta13b1d56f04cc83374c3a29c668e7b421e5e32f6 (diff)
downloadmongo-b6f2129ad1c00c474586625efaa8880fb8eac331.tar.gz
SERVER-63201 Allow user deletes on capped collections
Diffstat (limited to 'jstests')
-rw-r--r--jstests/noPassthroughWithMongod/capped4.js3
-rw-r--r--jstests/replsets/apply_ops_capped_collection.js11
2 files changed, 11 insertions, 3 deletions
diff --git a/jstests/noPassthroughWithMongod/capped4.js b/jstests/noPassthroughWithMongod/capped4.js
index c659ff65935..f948614f24e 100644
--- a/jstests/noPassthroughWithMongod/capped4.js
+++ b/jstests/noPassthroughWithMongod/capped4.js
@@ -23,7 +23,6 @@ assert(!d.hasNext(), "C");
assert(t.find().sort({i: 1}).hint({i: 1}).toArray().length > 10, "D");
assert(t.findOne({i: i - 1}), "E");
-var res = assert.writeError(t.remove({i: i - 1}));
-assert(res.getWriteError().errmsg.indexOf("capped") >= 0, "F");
+assert(t.remove({i: i - 1}));
assert(t.validate().valid, "G");
diff --git a/jstests/replsets/apply_ops_capped_collection.js b/jstests/replsets/apply_ops_capped_collection.js
index 2bd5d00f604..cfdd7ec6299 100644
--- a/jstests/replsets/apply_ops_capped_collection.js
+++ b/jstests/replsets/apply_ops_capped_collection.js
@@ -1,7 +1,12 @@
/**
* Tests the applyOps command on a capped collection that needs capped deletes.
+ * Tests that a delete applyOps command against a capped collection works.
*
- * @tags: [requires_capped, requires_replication]
+ * @tags: [
+ * multiversion_incompatible,
+ * requires_capped,
+ * requires_replication,
+ * ]
*/
(function() {
"use strict";
@@ -29,5 +34,9 @@ for (let i = 0; i < 20; i++) {
assert.commandWorked(db.runCommand({applyOps: ops}));
+// Test that capped deletes via applyOps are permitted.
+assert.commandWorked(db.runCommand(
+ {applyOps: [{op: "d", ns: nss(dbName, collName), ts: Timestamp(20, 0), o: {_id: 19}}]}));
+
rst.stopSet();
}());