summaryrefslogtreecommitdiff
path: root/jstests/core
diff options
context:
space:
mode:
authorGeert Bosch <geert@mongodb.com>2017-11-30 14:05:06 -0500
committerGeert Bosch <geert@mongodb.com>2017-11-30 18:08:19 -0500
commit33025572fa0964a67528f9f2317a0f2cd6a03310 (patch)
treea8b0ed556257a2bda912b34b162d1c247469102d /jstests/core
parent00e4df53051c768ead5fbb69c43f169dee57bcde (diff)
downloadmongo-33025572fa0964a67528f9f2317a0f2cd6a03310.tar.gz
SERVER-32125 Only add/remove UUIDs during upgrade/downgrade
(cherry picked from commit e1f3a9bccaadce1772d6cf7d5f9b44ca3adbee3e)
Diffstat (limited to 'jstests/core')
-rw-r--r--jstests/core/collmod_without_uuid.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/jstests/core/collmod_without_uuid.js b/jstests/core/collmod_without_uuid.js
new file mode 100644
index 00000000000..87d65d398b2
--- /dev/null
+++ b/jstests/core/collmod_without_uuid.js
@@ -0,0 +1,21 @@
+/**
+ * SERVER-32125 Check that applyOps commands with collMod without UUID don't strip it
+ */
+(function() {
+ "use strict";
+ const collName = "collmod_without_uuid";
+
+ function checkUUIDs() {
+ let infos = db.getCollectionInfos();
+ assert(infos.every((coll) => coll.name != collName || coll.info.uuid != undefined),
+ "Not all collections have UUIDs: " + tojson({infos}));
+ }
+
+ db[collName].drop();
+ assert.writeOK(db[collName].insert({}));
+ checkUUIDs();
+ let cmd = {applyOps: [{ns: "test.$cmd", op: "c", o: {collMod: collName}}]};
+ let res = db.runCommand(cmd);
+ assert.commandWorked(res, tojson(cmd));
+ checkUUIDs();
+})();