src/mongo/shell/feature_compatibility_version.js
/**
 * Since SERVER-29453 disallowed removal of the FCV document, we need to do this hack to remove it.
 */
Since SERVER-29453 disallowed removal of the FCV document, we need to do this hack to remove it.
Since SERVER - 29453 disallowed removal of the FCV document we need to do this hack to remove it .
function removeFCVDocument(adminDB) {
    let res = adminDB.runCommand({listCollections: 1, filter: {name: "system.version"}});
    assert.commandWorked(res, "failed to list collections");
    let originalUUID = res.cursor.firstBatch[0].info.uuid;
    let newUUID = UUID();
    let createNewAdminSystemVersionCollection =
        {op: "c", ns: "admin.$cmd", ui: newUUID, o: {create: "system.version"}};
    let dropOriginalAdminSystemVersionCollection =
        {op: "c", ns: "admin.$cmd", ui: originalUUID, o: {drop: "admin.tmp_system_version"}};
    assert.commandWorked(adminDB.runCommand({
        applyOps: [createNewAdminSystemVersionCollection, dropOriginalAdminSystemVersionCollection]
    }));
    res = adminDB.runCommand({listCollections: 1, filter: {name: "system.version"}});
    assert.commandWorked(res, "failed to list collections");
    assert.eq(newUUID, res.cursor.firstBatch[0].info.uuid);
}
function removeFCVDocument ( adminDB ) { let res = adminDB . runCommand ( { listCollections : 1 , filter : { name : "system.version" } } ) ; assert . commandWorked ( res , "failed to list collections" ) ; let originalUUID = res . cursor . firstBatch [ 0 ] . info . uuid ; let newUUID = UUID ( ) ; let createNewAdminSystemVersionCollection = { op : "c" , ns : "admin.$cmd" , ui : newUUID , o : { create : "system.version" } } ; let dropOriginalAdminSystemVersionCollection = { op : "c" , ns : "admin.$cmd" , ui : originalUUID , o : { drop : "admin.tmp_system_version" } } ; assert . commandWorked ( adminDB . runCommand ( { applyOps : [ createNewAdminSystemVersionCollection , dropOriginalAdminSystemVersionCollection ] } ) ) ; res = adminDB . runCommand ( { listCollections : 1 , filter : { name : "system.version" } } ) ; assert . commandWorked ( res , "failed to list collections" ) ; assert . eq ( newUUID , res . cursor . firstBatch [ 0 ] . info . uuid ) ; }
Since SERVER-29453 disallowed removal of the FCV document, we need to do this hack to remove it.
Since SERVER - 29453 disallowed removal of the FCV document we need to do this hack to remove it .
// Create new collection with no FCV document, and then delete the // original collection.