Enable and disable balancing on a collection
Shell commands sh.enableBalancing() and sh.disableBalancing() were not permitted on Atlas hosted MongoDB. Is it possible to grant this permission?
Currently it failed with error:
uncaught exception: Error: command failed: {
"ok" : 0,
"errmsg" : "not authorized on config to execute command { update: \"collections\", ordered: true, writeConcern: { w: \"majority\", wtimeout: 60000.0 }, lsid: { id: UUID(\"ed83ed26-e07b-4f34-a90a-a145bbe58a48\") }, $clusterTime: { clusterTime: Timestamp(1646788928, 17), signature: { hash: BinData(0, 347249E35ED43BDADAE12FB0F794C091CB86206E), keyId: 7052082196881866761 } }, $db: \"config\" }",
"code" : 13,
"codeName" : "Unauthorized",
"operationTime" : Timestamp(1646788928, 18),
"$clusterTime" : {
"clusterTime" : Timestamp(1646788928, 18),
"signature" : {
"hash" : BinData(0,"NHJJ417UO9ra4S+w95TAkcuGIG4="),
"keyId" : NumberLong("7052082196881866761")
}
}
} :
_getErrorWithCode@src/mongo/shell/utils.js:25:13
doassert@src/mongo/shell/assert.js:18:14
_assertCommandWorked@src/mongo/shell/assert.js:710:13
assert.commandWorked@src/mongo/shell/assert.js:811:16
sh.disableBalancing@src/mongo/shell/utils_sh.js:282:12
@(shell):1:1