summaryrefslogtreecommitdiff
path: root/jstests
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2021-02-21 03:35:22 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-02-22 09:28:50 +0000
commit83e535beb0ae4089a4f7bfb2418f3be56803d7ef (patch)
tree8cb2188b5746ce352df6b8c4d8b0abd371dd2230 /jstests
parent29c751e8e250d4368aa592717cf323a08947acad (diff)
downloadmongo-83e535beb0ae4089a4f7bfb2418f3be56803d7ef.tar.gz
SERVER-54585 Enable running `findAndModify` against the Config server collections
(cherry picked from commit a40e23d8613ad123e26112a61e26963909f1fa07)
Diffstat (limited to 'jstests')
-rw-r--r--jstests/core/find_and_modify.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/jstests/core/find_and_modify.js b/jstests/core/find_and_modify.js
index df698f17811..a86ed841548 100644
--- a/jstests/core/find_and_modify.js
+++ b/jstests/core/find_and_modify.js
@@ -149,3 +149,18 @@ assert.eq("missagain", cmdRes.value._id);
// Two upserts should have happened.
assert.eq(2, t.count());
+
+//
+// findAndModify must work against the admin and config collections
+//
+
+['admin', 'config'].forEach(function(dbName) {
+ var sysDb = db.getSiblingDB(dbName);
+ assert.commandWorked(sysDb.runCommand({
+ findAndModify: 'find_and_modify_js_test',
+ query: {_id: 0},
+ update: {'$set': {Value: dbName}},
+ upsert: true,
+ new: true,
+ }));
+});