Database Manual / Sharding / Reference

Shard Direct Commands

Starting in MongoDB 8.0, these are the only commands you may run directly on a shard. You may also run a shell helper directly on a shard if it calls one of the following commands:

Note

This page may not be an exhaustive list [1].

CommandAvailable Helper Methods

abortTransaction

Session.abortTransaction()

appendOplogNote

authenticate

passwordPrompt()

autoCompact

buildInfo

commitTransaction

Session.commitTransaction() Session.withTransaction()

compact

connectionStatus

connPoolStats

createRole

db.createRole()

createUser

db.createUser()

currentOp

db.currentOp()

dbHash (Added in 8.0.5)

dropAllRolesFromDatabase

db.dropAllRoles()

dropAllUsersFromDatabase

db.dropAllUsers()

dropRole

db.dropRole()

dropUser

db.dropUser()

endSessions

flushRouterConfig

fsync

db.fsyncLock()

fsyncUnlock

db.fsyncUnlock()

getAuditConfig

getClusterParameter

getCmdLineOpts

getLog

getParameter

getShardMap

grantPrivilegesToRole

db.grantPrivilegesToRole()

grantRolesToRole

db.grantRolesToRole()

grantRolesToUser

db.grantRolesToUser()

hello

hostInfo

invalidateUserCache

killAllSessions

killAllSessionsByPattern

killCursors

killOp

killSessions

listCommands

lockInfo

logApplicationMessage

logout

logRotate

ping

profile

db.setProfilingLevel()

replSetAbortPrimaryCatchUp

replSetFreeze

rs.freeze()

replSetGetConfig

rs.conf()

replSetGetStatus

rs.status()

replSetMaintenance

replSetReconfig

rs.reconfig()

replSetResizeOplog

replSetStepDown

rs.stepDown()

replSetSyncFrom

rs.syncFrom()

revokePrivilegesFromRole

db.revokePrivilegesFromRole()

revokeRolesFromRole

db.revokeRolesFromRole()

revokeRolesFromUser

db.revokeRolesFromUser()

rolesInfo

rotateCertificates

serverStatus

setParameter

shardingState

startSession

Mongo.startSession()

top

updateRole

db.updateRole()

updateUser

db.changeUserPassword()

usersInfo

whatsmyuri

[1] Specific command documentation may include compatibility info.