Diagnostic Commands


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

availableQueryOptionsInternal command that reports on the capabilities of the current MongoDB instance.
buildInfoDisplays statistics about the MongoDB build.
collStatsReports storage utilization statics for a specified collection.
connPoolStatsReports statistics on the outgoing connections from this MongoDB instance to other MongoDB instances in the deployment.
connectionStatusReports the authentication state for the current connection.
cursorInfoRemoved in MongoDB 3.2. Replaced with metrics.cursor.
dataSizeReturns the data size for a range of data. For internal use.
dbHashReturns hash value a database and its collections.
dbStatsReports storage utilization statistics for the specified database.
diagLoggingRemoved in MongoDB 3.6. To capture, replay, and profile commands sent to your MongoDB deployment, use mongoreplay.
driverOIDTestInternal command that converts an ObjectId to a string to support tests.
explainReturns information on the execution of various operations.
featuresReports on features available in the current MongoDB instance.
getCmdLineOptsReturns a document with the run-time arguments to the MongoDB instance and their parsed options.
getLogReturns recent log messages.
hostInfoReturns data that reflects the underlying host system.
isSelfInternal command to support testing.
listCommandsLists all database commands provided by the current mongod instance.
netstatInternal command that reports on intra-deployment connectivity. Only available for mongos instances.
pingInternal command that tests intra-deployment connectivity.
profileInterface for the database profiler.
serverStatusReturns a collection metrics on instance-wide resource utilization and status.
shardConnPoolStatsReports statistics on a mongos’s connection pool for client operations against shards.
topReturns raw usage statistics for each database in the mongod instance.
validateInternal command that scans for a collection’s data and indexes for correctness.
whatsmyuriInternal command that returns information on the current client.