Files
mongo/jstests/core/collmod_without_uuid.js
Jack Mulrow 00d92ece19 SERVER-31194 Add jscore tags for retryable_writes_jscore_stepdown_passthrough.yml suite
The actual suite will come in a follow-up commit.
2017-12-07 14:36:15 -05:00

24 lines
729 B
JavaScript

// @tags: [requires_non_retryable_commands]
/**
* 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();
})();