Files
mongo/jstests/multiVersion/genericSetFCVUsage/remove_feature_compatibility_version.js
Zac 591928c619 SERVER-108478 JS formatted by prettier and remove clang-format (#39656)
GitOrigin-RevId: 6c8f6aded47f260aa4f7c231b17dae3302cb1e04
2025-08-21 17:27:09 +00:00

16 lines
623 B
JavaScript

/**
* This test is for SERVER-29453: Renaming the admin.system.version collection
* or removing the FCV document should not be allowed.
*/
let standalone = MongoRunner.runMongod();
assert.neq(null, standalone, "mongod was unable to start up");
let adminDB = standalone.getDB("admin");
// Renaming the collection or deleting the document should fail.
assert.commandFailedWithCode(
adminDB.runCommand({renameCollection: "admin.system.version", to: "admin.dummy.collection"}),
ErrorCodes.IllegalOperation,
);
assert.writeErrorWithCode(adminDB.system.version.remove({}), 40670);
MongoRunner.stopMongod(standalone);