For details on specific methods, including syntax and examples, click on the specific method to go to its reference page.
Runs a command against the
Runs admin/diagnostic pipeline which does not require an underlying collection.
Deprecated. Copies a database from a remote host to the current host when run against MongoDB 4.0 or earlier. Unsupported when run against MongoDB 4.2 or later.
Returns help information for a database command.
Deprecated. Copies a database to another database on the current host when run against MongoDB 4.0 or earlier. Unsupported when run against MongoDB 4.2 or later.
Creates a new collection or a view. Commonly used to create a capped collection.
Creates a view.
Reports the current in-progress operations.
Removes the current database.
Flushes writes to disk and locks the database to prevent write operations and assist backup operations. Wraps
Allows writes to continue on a database locked with
Returns a collection or view object. Used to access collections with names that are not valid in the
Returns collection information for all collections and views in the current database.
Lists all collections and views in the current database.
Checks and returns the status of the last operation. Wraps
Returns the status document for the last operation. Wraps
Returns the log message verbosity levels.
Returns the name of the current database.
Returns the current profiling level for database operations.
Returns a document that reflects the current profiling level and the profiling threshold.
Returns a document with replication statistics.
Provides access to the specified database.
Returns a document that reports the state of the replica set.
Displays descriptions of common
Returns a document with information about the system MongoDB runs on. Wraps
Terminates a specified operation.
Displays a list of common database commands.
Ends an authenticated session.
Prints statistics from every collection. Wraps
Prints a formatted report of the replica set status from the perspective of the primary.
Prints a formatted report of the replica set status from the perspective of the secondaries.
Prints a report of the sharding configuration and the chunk ranges.
Deprecated since version 4.4.1: Use
Deprecated. Resets the last error status.
Runs a database command.
Returns a document with information about the runtime used to start the MongoDB instance. Wraps
Returns a document that provides an overview of the state of the database process.
Sets a single log message verbosity level.
Modifies the current level of database profiling.
Returns a document that reports on the state of the current database.
Returns the version of the
Opens a change stream cursor for a database to report on all its non-