Docs HomeMongoDB Manual

Administration Commands

Note

For details on a specific command, including syntax and examples, click on the link to the command's reference page.

NameDescription
cloneCollectionAsCappedCopies a non-capped collection as a new capped collection.
collModAdd options to a collection or modify a view definition.
compactDefragments a collection and rebuilds the indexes.
convertToCappedConverts a non-capped collection to a capped collection.
createCreates a collection or a view.
createIndexesBuilds one or more indexes for a collection.
currentOpReturns a document that contains information on in-progress operations for the database instance.
dropRemoves the specified collection from the database.
dropDatabaseRemoves the current database.
dropConnectionsDrops outgoing connections to the specified list of hosts.
dropIndexesRemoves indexes from a collection.
filemd5Returns the md5 hash for files stored using GridFS.
fsyncFlushes pending writes to the storage layer and locks the database to allow backups.
fsyncUnlockUnlocks one fsync lock.
getDefaultRWConcernRetrieves the global default read and write concern options for the deployment.
New in version 4.4.
getAuditConfigRetrieves details on audit configuration and filters.
New in version 5.0.
getClusterParameterRetrieves cluster parameter values from all nodes in a cluster.
New in version 6.0.
getParameterRetrieves configuration options.
killCursorsKills the specified cursors for a collection.
killOpTerminates an operation as specified by the operation ID.
listCollectionsReturns a list of collections in the current database.
listDatabasesReturns a document that lists all databases and returns basic database statistics.
listIndexesLists all indexes for a collection.
logRotateRotates the MongoDB logs to prevent a single file from taking too much space.
reIndexRebuilds all indexes on a collection.
renameCollectionChanges the name of an existing collection.
rotateCertificatesPerforms online TLS certificate rotation.
setFeatureCompatibilityVersionEnables or disables features that persist data that are backwards-incompatible.
setIndexCommitQuorumChanges the minimum number of data-bearing members (i.e commit quorum), including the primary, that must vote to commit an in-progress index build before the primary marks those indexes as ready.
setClusterParameterModifies configuration options for all nodes in a cluster.
New in version 6.0.
setParameterModifies configuration options.
setDefaultRWConcernSets the global default read and write concern options for the deployment.
New in version 4.4.
shutdownShuts down the mongod or mongos process.