Administration Commands

Note

For details on specific commands, including syntax and examples,click on the specific command to go to its reference page.

NameDescription
cleanInternal namespace administration command.
cloneCollectionCopies a collection from a remote host to the current host.
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.
connPoolSyncInternal command to flush connection pool.
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.
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.
setFeatureCompatibilityVersionEnables or disables features that persist data that are backwards-incompatible.
setParameterModifies configuration options.
shutdownShuts down the mongod or mongos process.