Navigation

Administration Commands

Note

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

Name Description
clean Internal namespace administration command.
cloneCollection Copies a collection from a remote host to the current host.
cloneCollectionAsCapped Copies a non-capped collection as a new capped collection.
collMod Add options to a collection or modify a view definition.
compact Defragments a collection and rebuilds the indexes.
connPoolSync Internal command to flush connection pool.
convertToCapped Converts a non-capped collection to a capped collection.
create Creates a collection or a view.
createIndexes Builds one or more indexes for a collection.
currentOp Returns a document that contains information on in-progress operations for the database instance.
drop Removes the specified collection from the database.
dropDatabase Removes the current database.
dropIndexes Removes indexes from a collection.
filemd5 Returns the md5 hash for files stored using GridFS.
fsync Flushes pending writes to the storage layer and locks the database to allow backups.
fsyncUnlock Unlocks one fsync lock.
getParameter Retrieves configuration options.
killCursors Kills the specified cursors for a collection.
killOp Terminates an operation as specified by the operation ID.
listCollections Returns a list of collections in the current database.
listDatabases Returns a document that lists all databases and returns basic database statistics.
listIndexes Lists all indexes for a collection.
logRotate Rotates the MongoDB logs to prevent a single file from taking too much space.
reIndex Rebuilds all indexes on a collection.
renameCollection Changes the name of an existing collection.
setFeatureCompatibilityVersion Enables or disables features that persist data that are backwards-incompatible.
setParameter Modifies configuration options.
shutdown Shuts down the mongod or mongos process.
←   startSession clean  →