# Database Manual - (manual) (Part 3 of 10) > This part of the MongoDB reference covers general reference material and most of the database commands reference. - [Manual Reference](https://www.mongodb.com/docs/manual/reference.md): Explore MongoDB reference materials including database commands, connection strings, error codes, glossary terms, and MongoDB Query Language references. - [Aggregation Commands Comparison](https://www.mongodb.com/docs/manual/reference/aggregation-commands-comparison.md): Compare MongoDB's aggregation pipeline and map-reduce, highlighting performance, flexibility, and output differences. - [Variables in Aggregation Expressions](https://www.mongodb.com/docs/manual/reference/aggregation-variables.md): Explore how to use user-defined and system variables in MongoDB aggregation expressions, including accessing and modifying data. - [Aggregation Reference](https://www.mongodb.com/docs/manual/reference/aggregation.md): Explore MongoDB's aggregation capabilities, including pipeline stages, operators, and comparisons with SQL and `mapReduce`. - [System Event Audit Messages](https://www.mongodb.com/docs/manual/reference/audit-message.md): Explore how to configure and use system event audit messages in MongoDB Enterprise and Atlas, including schema options for log message output. - [mongo Schema Audit Messages](https://www.mongodb.com/docs/manual/reference/audit-message/mongo.md) - [OCSF Schema Audit Messages](https://www.mongodb.com/docs/manual/reference/audit-message/ocsf.md) - [The ``bios`` Example Collection](https://www.mongodb.com/docs/manual/reference/bios-example-collection.md): Explore the `bios` collection with example data for experimenting with MongoDB, showcasing various contributors and their awards. - [Comparison/Sort Order](https://www.mongodb.com/docs/manual/reference/bson-type-comparison-order.md): Understand the BSON type comparison order used by MongoDB for sorting and querying operations, including type-specific rules for arrays, objects, and strings. - [MongoDB BSON Types](https://www.mongodb.com/docs/manual/reference/bson-types.md): MongoDB uses BSON (Binary JSON) to store documents and make remote procedure calls. Learn about BSON types, ObjectId, dates, timestamps, and decimal precision. - [Migrate Undefined Data and Queries](https://www.mongodb.com/docs/manual/reference/bson-types/migrate-undefined.md) - [Built-In Roles](https://www.mongodb.com/docs/manual/reference/built-in-roles.md): Control access to local MongoDB and MongoDB Atlas deployments by using built-in roles and privileges. - [Change Stream Events](https://www.mongodb.com/docs/manual/reference/change-events.md): Monitor changes in MongoDB collections, databases, or deployments using change streams, which provide notifications for various operation types, including DDL events. - [create Event](https://www.mongodb.com/docs/manual/reference/change-events/create.md): Understand the `create` event in MongoDB change streams, which occurs when a collection is created with the showExpandedEvents option enabled. - [createIndexes Event](https://www.mongodb.com/docs/manual/reference/change-events/createIndexes.md): Understand the `createIndexes` event in MongoDB change streams, which occurs when an index is created with expanded events enabled. - [delete Event](https://www.mongodb.com/docs/manual/reference/change-events/delete.md): Understand the structure and fields of a `delete` event in MongoDB change streams, including identifiers and timestamps. - [drop Event](https://www.mongodb.com/docs/manual/reference/change-events/drop.md): Understand the `drop` event in MongoDB, which occurs when a collection is removed from a database, including its fields and example structure. - [dropDatabase Event](https://www.mongodb.com/docs/manual/reference/change-events/dropDatabase.md): Understand the `dropDatabase` event in MongoDB, which occurs when a database is dropped, including its fields and example structure. - [dropIndexes Event](https://www.mongodb.com/docs/manual/reference/change-events/dropIndexes.md): Understand the `dropIndexes` event in MongoDB change streams, which occurs when an index is dropped from a collection with expanded events enabled. - [insert Event](https://www.mongodb.com/docs/manual/reference/change-events/insert.md): Understand the structure and fields of an `insert` event in MongoDB change streams, including `fullDocument` and `documentKey`. - [invalidate Event](https://www.mongodb.com/docs/manual/reference/change-events/invalidate.md): Understand how `invalidate` events occur in change streams when operations like drop or rename make the stream invalid. - [``modify`` Event](https://www.mongodb.com/docs/manual/reference/change-events/modify.md): Understand the modify event in MongoDB change streams, which occurs when collection options are altered, requiring the showExpandedEvents option to be enabled. - [refineCollectionShardKey Event](https://www.mongodb.com/docs/manual/reference/change-events/refineCollectionShardKey.md): Describe the `refineCollectionShardKey` event, which occurs when a collection's shard key is modified, including its fields and example structure. - [``rename`` Event](https://www.mongodb.com/docs/manual/reference/change-events/rename.md): Understand the `rename` event in MongoDB, which occurs when a collection is renamed, including details on fields like `operationType`, `ns`, and `to`. - [``replace`` Event](https://www.mongodb.com/docs/manual/reference/change-events/replace.md): Understand the `replace` event in MongoDB change streams, which occurs when a document is replaced with a new one during an update operation. - [reshardCollection Event](https://www.mongodb.com/docs/manual/reference/change-events/reshardCollection.md): Understand the reshardCollection event, which occurs when a collection's shard key and data distribution change, with detailed field descriptions and an example. - [``shardCollection`` Event](https://www.mongodb.com/docs/manual/reference/change-events/shardCollection.md): Understand the `shardCollection` event in MongoDB, which occurs when a collection is sharded, including its fields and an example of the event structure. - [``update`` Event](https://www.mongodb.com/docs/manual/reference/change-events/update.md): Understand the `update` event in MongoDB change streams, detailing fields like `updateDescription` and `fullDocument`. - [Cluster Parameters for a Self-Managed Deployment](https://www.mongodb.com/docs/manual/reference/cluster-parameters.md): Configure MongoDB cluster parameters to manage settings across all nodes in a replica set or sharded cluster. - [auditConfig](https://www.mongodb.com/docs/manual/reference/cluster-parameters/auditConfig.md) - [changeStreamOptions](https://www.mongodb.com/docs/manual/reference/cluster-parameters/changeStreamOptions.md) - [defaultMaxTimeMS](https://www.mongodb.com/docs/manual/reference/cluster-parameters/defaultMaxTimeMS.md) - [Collation Locales and Default Parameters](https://www.mongodb.com/docs/manual/reference/collation-locales-defaults.md): Explore language-specific collation rules for string comparison in MongoDB, including supported locales and default parameters. - [MongoDB Collation](https://www.mongodb.com/docs/manual/reference/collation.md): Use collation to compare strings in different languages with language-specific rules for lettercase and accent marks. Specify collation for a collection, view, index, or query operation. - [Database Commands](https://www.mongodb.com/docs/manual/reference/command.md): Details on MongoDB database commands, their parameters, and usage examples. - [abortMoveCollection (database command)](https://www.mongodb.com/docs/manual/reference/command/abortMoveCollection.md) - [abortReshardCollection (database command)](https://www.mongodb.com/docs/manual/reference/command/abortReshardCollection.md): Abort a resharding operation in MongoDB using the `abortReshardCollection` command before the commit phase. - [abortRewriteCollection (database command)](https://www.mongodb.com/docs/manual/reference/command/abortRewriteCollection.md) - [abortTransaction (database command)](https://www.mongodb.com/docs/manual/reference/command/abortTransaction.md): Terminate a multi-document transaction using the abortTransaction command, which rolls back all changes made during the transaction. - [abortUnshardCollection (database command)](https://www.mongodb.com/docs/manual/reference/command/abortUnshardCollection.md) - [addShard (database command)](https://www.mongodb.com/docs/manual/reference/command/addShard.md): Add a shard replica set to a sharded cluster using the `addShard` command, ensuring the shard is empty and considering balancing effects. - [addShardToZone (database command)](https://www.mongodb.com/docs/manual/reference/command/addShardToZone.md): Associate a shard with a zone using the `addShardToZone` command, which is available in MongoDB Atlas, Enterprise, and Community environments. - [aggregate (database command)](https://www.mongodb.com/docs/manual/reference/command/aggregate.md): Perform data aggregation using the aggregation pipeline with options such as collation, read concern, index hints, write concern, and custom let variables. - [analyzeShardKey (database command)](https://www.mongodb.com/docs/manual/reference/command/analyzeShardKey.md): Evaluate shard keys for collections using the `analyzeShardKey` command to calculate metrics based on sampled queries. - [appendOplogNote (database command)](https://www.mongodb.com/docs/manual/reference/command/appendOplogNote.md): Append a non-operational entry to the oplog using the `appendOplogNote` command on the `admin` database. - [applyOps (database command)](https://www.mongodb.com/docs/manual/reference/command/applyOps.md): Execute the `applyOps` command to apply specified oplog entries to a `mongod` instance, requiring a global write lock. - [authenticate (database command)](https://www.mongodb.com/docs/manual/reference/command/authenticate.md): Authenticate using the X.509 mechanism with `db.auth()` in `mongosh`, supporting MongoDB Atlas, Enterprise, and Community environments. - [autoCompact (database command)](https://www.mongodb.com/docs/manual/reference/command/autoCompact.md) - [balancerCollectionStatus (database command)](https://www.mongodb.com/docs/manual/reference/command/balancerCollectionStatus.md): Check if chunks in a sharded collection are balanced using the `balancerCollectionStatus` command in MongoDB. - [balancerStart (database command)](https://www.mongodb.com/docs/manual/reference/command/balancerStart.md): Start the balancer thread on a `mongos` instance using the `balancerStart` command or `sh.startBalancer()` method. - [balancerStatus (database command)](https://www.mongodb.com/docs/manual/reference/command/balancerStatus.md): Check the status of the balancer in MongoDB using the `balancerStatus` command to see if it's running or stopped. - [balancerStop (database command)](https://www.mongodb.com/docs/manual/reference/command/balancerStop.md): Disable the balancer in a sharded cluster using the `balancerStop` command, ensuring to re-enable it after maintenance to avoid performance issues. - [buildInfo (database command)](https://www.mongodb.com/docs/manual/reference/command/buildInfo.md): Retrieve a build summary for the current `mongod` using the `buildInfo` command, detailing version, storage engines, and more. - [bulkWrite (database command)](https://www.mongodb.com/docs/manual/reference/command/bulkWrite.md): Use the bulkWrite database command to perform CRUD operations across multiple collections in a single request. Includes syntax, command fields, output reference, and examples. - [checkMetadataConsistency (database command)](https://www.mongodb.com/docs/manual/reference/command/checkMetadataConsistency.md): Perform consistency checks on sharding metadata for clusters, databases, or collections using the `checkMetadataConsistency` command. - [cleanupOrphaned (database command)](https://www.mongodb.com/docs/manual/reference/command/cleanupOrphaned.md): Use the `cleanupOrphaned` command to remove orphaned documents from a shard's primary replica set member without disabling the balancer. - [cleanupReshardCollection (database command)](https://www.mongodb.com/docs/manual/reference/command/cleanupReshardCollection.md): Clean up metadata from a failed resharding operation using the `cleanupReshardCollection` command after a primary failover. - [clearJumboFlag (database command)](https://www.mongodb.com/docs/manual/reference/command/clearJumboFlag.md): Clear the jumbo flag for a chunk in a sharded collection using the `clearJumboFlag` command on a `mongos` instance. - [cloneCollectionAsCapped (database command)](https://www.mongodb.com/docs/manual/reference/command/cloneCollectionAsCapped.md): Create a new capped collection from an existing non-capped collection using the `cloneCollectionAsCapped` command, specifying the maximum size in bytes. - [collMod (database command)](https://www.mongodb.com/docs/manual/reference/command/collMod.md): Modify collection options or view definitions using the `collMod` command, including changing index properties, validation rules, and time series settings. - [collStats (database command)](https://www.mongodb.com/docs/manual/reference/command/collStats.md): Access storage statistics for a collection using the `collStats` command, with options for scaling and compatibility across different MongoDB environments. - [commitReshardCollection (database command)](https://www.mongodb.com/docs/manual/reference/command/commitReshardCollection.md): Force the completion of a resharding operation by blocking writes with the `commitReshardCollection` command. - [commitShardRemoval (database command)](https://www.mongodb.com/docs/manual/reference/command/commitShardRemoval.md): How to use the commitShardRemoval command to finish removing a fully drained shard from a MongoDB sharded cluster. - [commitTransaction (database command)](https://www.mongodb.com/docs/manual/reference/command/commitTransaction.md): Execute the `commitTransaction` command to save changes from a multi-document transaction and end the transaction in MongoDB. - [commitTransitionToDedicatedConfigServer (database command)](https://www.mongodb.com/docs/manual/reference/command/commitTransitionToDedicatedConfigServer.md): Tells the balancer to move chunks from a shard to other shards in the cluster. Commits the transition from an embedded config server to a dedicated config server. - [compact (database command)](https://www.mongodb.com/docs/manual/reference/command/compact.md): Run the compact command to release unneeded disk space from a collection and its indexes back to the operating system. Use compact to reclaim storage from deleted or fragmented data. - [compactStructuredEncryptionData (database command)](https://www.mongodb.com/docs/manual/reference/command/compactStructuredEncryptionData.md): Use the `compactStructuredEncryptionData` command to compact documents in metadata collections and remove redundant entries. - [configureCollectionBalancing (database command)](https://www.mongodb.com/docs/manual/reference/command/configureCollectionBalancing.md): Configure balancer settings for a sharded collection with examples of command behavior. - [configureQueryAnalyzer (database command)](https://www.mongodb.com/docs/manual/reference/command/configureQueryAnalyzer.md): Configure query sampling for collections to analyze shard key metrics in replica sets or sharded clusters. - [connPoolStats (database command)](https://www.mongodb.com/docs/manual/reference/command/connPoolStats.md): Retrieve statistics on outgoing connections from a MongoDB instance using the `connPoolStats` command. - [connectionStatus (database command)](https://www.mongodb.com/docs/manual/reference/command/connectionStatus.md): Retrieve the current connection's authentication state and user permissions using the `connectionStatus` command. - [convertToCapped (database command)](https://www.mongodb.com/docs/manual/reference/command/convertToCapped.md): Convert a non-capped collection to a capped collection using the `convertToCapped` command, specifying the maximum size in bytes for the capped collection. - [count (database command)](https://www.mongodb.com/docs/manual/reference/command/count.md): Use the count database command to count documents in a collection or view. Supports query filters, skip, limit, hint, collation, and read concern options. - [create (database command)](https://www.mongodb.com/docs/manual/reference/command/create.md): Create collections or views in MongoDB using the ``create`` command, with options for capped collections, time series, clustered indexes, and more features. - [createIndexes (database command)](https://www.mongodb.com/docs/manual/reference/command/createIndexes.md): Build one or more indexes on a collection using the `createIndexes` command, with options for write concern, commit quorum, and index types. - [createRole (database command)](https://www.mongodb.com/docs/manual/reference/command/createRole.md): Create a role in MongoDB with specified privileges, inheriting from other roles, and optional authentication restrictions. - [createSearchIndexes (database command)](https://www.mongodb.com/docs/manual/reference/command/createSearchIndexes.md): Create MongoDB Search or Vector Search indexes on a specified collection using the `createSearchIndexes` command in MongoDB. - [createUser (database command)](https://www.mongodb.com/docs/manual/reference/command/createUser.md): How to create a new database user with defined database permissions based on role. - [currentOp (database command)](https://www.mongodb.com/docs/manual/reference/command/currentOp.md): Retrieve information on in-progress operations using the `$currentOp` aggregation stage, replacing the deprecated `currentOp` command. - [dataSize (database command)](https://www.mongodb.com/docs/manual/reference/command/dataSize.md): Determine the size in bytes of specified data using the `dataSize` command, with options for key patterns and range bounds. - [dbHash (database command)](https://www.mongodb.com/docs/manual/reference/command/dbHash.md): Compare databases across `mongod` instances using the `dbHash` command to return hash values and MD5 values for collections. - [dbStats (database command)](https://www.mongodb.com/docs/manual/reference/command/dbStats.md): Retrieve storage statistics for a database using the `dbStats` command, including options for scaling and free storage details. - [delete (database command)](https://www.mongodb.com/docs/manual/reference/command/delete.md): Run the `delete` database command to remove documents from a collection, with options for multiple delete specifications and additional command fields. - [distinct (database command)](https://www.mongodb.com/docs/manual/reference/command/distinct.md): Use the distinct database command to find unique values for a field across a collection, with support for query filters, collation, read concern, and index hints. - [drop (database command)](https://www.mongodb.com/docs/manual/reference/command/drop.md): Remove an entire collection from a database using the `drop` command, which also deletes associated indexes and handles in-progress index builds. - [dropAllRolesFromDatabase (database command)](https://www.mongodb.com/docs/manual/reference/command/dropAllRolesFromDatabase.md): Delete all user-defined roles from a database using the `dropAllRolesFromDatabase` command. - [dropAllUsersFromDatabase (database command)](https://www.mongodb.com/docs/manual/reference/command/dropAllUsersFromDatabase.md): Remove all users from a database using the `dropAllUsersFromDatabase` command, with optional write concern and comment fields. - [dropConnections (database command)](https://www.mongodb.com/docs/manual/reference/command/dropConnections.md): Drop outgoing connections from `mongod` or `mongos` instances to specified hosts using the `dropConnections` command in the admin database. - [dropDatabase (database command)](https://www.mongodb.com/docs/manual/reference/command/dropDatabase.md): Execute the `dropDatabase` command to delete the current database and its data files, with options for write concern and comments. - [dropIndexes (database command)](https://www.mongodb.com/docs/manual/reference/command/dropIndexes.md): Drop one or more indexes from a collection with the `dropIndexes` command, which cannot remove the index on the `_id` field or the last remaining shard key index. - [dropRole (database command)](https://www.mongodb.com/docs/manual/reference/command/dropRole.md): Delete a user-defined role from a database using the `dropRole` command, with optional write concern and comment fields. - [dropSearchIndex (database command)](https://www.mongodb.com/docs/manual/reference/command/dropSearchIndex.md): Delete an existing MongoDB Search index using the `dropSearchIndex` command, specifying either the index ID or name. - [dropUser (database command)](https://www.mongodb.com/docs/manual/reference/command/dropUser.md): Remove a user from a database using the `dropUser` command, specifying optional write concern and comments. - [enableSharding (database command)](https://www.mongodb.com/docs/manual/reference/command/enableSharding.md): Create a database using the `enableSharding` command, which is not required for sharding collections starting from MongoDB 6.0. - [endSessions (database command)](https://www.mongodb.com/docs/manual/reference/command/endSessions.md): Expire sessions using the `endSessions` command to signal the server for cleanup, overriding the default timeout period. - [explain (database command)](https://www.mongodb.com/docs/manual/reference/command/explain.md): Use the `explain` command to analyze query execution plans for MongoDB operations like find, count, update, and aggregate, including query planner and execution statistics. - [filemd5 (database command)](https://www.mongodb.com/docs/manual/reference/command/filemd5.md): Retrieve the md5 hash of a file stored in GridFS using the `filemd5` command to ensure correct file storage in MongoDB. - [find (database command)](https://www.mongodb.com/docs/manual/reference/command/find.md): Execute queries using the find command to retrieve documents with options such as sort order, limits, projections, index hints, collation, and read concern. - [findAndModify (database command)](https://www.mongodb.com/docs/manual/reference/command/findAndModify.md): Update and return a single document using the `findAndModify` database command, with options for sorting, upserting, and returning modified documents. - [flushRouterConfig (database command)](https://www.mongodb.com/docs/manual/reference/command/flushRouterConfig.md): Refresh the cached routing table for a sharded cluster using the `flushRouterConfig` command. - [fsync (database command)](https://www.mongodb.com/docs/manual/reference/command/fsync.md): the fsync command flushes all pending writes from the storage layer to disk. - [fsyncUnlock (database command)](https://www.mongodb.com/docs/manual/reference/command/fsyncUnlock.md): How to use fsyncUnlock to reduce the lock count on a MongoDB server or cluster and enable write operations. - [getAuditConfig (database command)](https://www.mongodb.com/docs/manual/reference/command/getAuditConfig.md): Retrieve audit configurations from `mongod` and `mongos` using the deprecated `getAuditConfig` command. - [getClusterParameter (database command)](https://www.mongodb.com/docs/manual/reference/command/getClusterParameter.md): Retrieve cluster parameter values using the `getClusterParameter` command in MongoDB environments. - [getCmdLineOpts (database command)](https://www.mongodb.com/docs/manual/reference/command/getCmdLineOpts.md): Retrieve command line options used to start `mongod` or `mongos` with the `getCmdLineOpts` command. - [getDefaultRWConcern (database command)](https://www.mongodb.com/docs/manual/reference/command/getDefaultRWConcern.md): Retrieve global default read and write concern settings using the `getDefaultRWConcern` command in MongoDB. - [getLastError (database command)](https://www.mongodb.com/docs/manual/reference/command/getLastError.md): Replace `getLastError` with the CRUD API for write operations to receive success or failure information directly from the driver. - [getLog (database command)](https://www.mongodb.com/docs/manual/reference/command/getLog.md): Retrieve recent `mongod` events using the `getLog` command, which reads from a RAM cache and returns data in JSON format. - [getMore (database command)](https://www.mongodb.com/docs/manual/reference/command/getMore.md): Use the getMore database command to retrieve the next batches of documents from a cursor. Includes syntax, command fields, output, and behavior for sessions and transactions. - [getParameter (database command)](https://www.mongodb.com/docs/manual/reference/command/getParameter.md): Retrieve parameter values using the getParameter command in the admin database, with options for detailed reports and filtering by runtime or startup settings. - [getShardMap (database command)](https://www.mongodb.com/docs/manual/reference/command/getShardMap.md): Retrieve shard and config server details of your MongoDB cluster using the `getShardMap` command, including hostnames and connection strings. - [getTransitionToDedicatedConfigServerStatus (database command)](https://www.mongodb.com/docs/manual/reference/command/getTransitionToDedicatedConfigServerStatus.md): Shows status of the transition from an embedded config server to a dedicated config server. - [grantPrivilegesToRole (database command)](https://www.mongodb.com/docs/manual/reference/command/grantPrivilegesToRole.md): Assign additional privileges to a user-defined role using the `grantPrivilegesToRole` command in MongoDB. - [grantRolesToRole (database command)](https://www.mongodb.com/docs/manual/reference/command/grantRolesToRole.md): Grant roles to a user-defined role using the `grantRolesToRole` command, specifying roles, write concern, and optional comments. - [grantRolesToUser (database command)](https://www.mongodb.com/docs/manual/reference/command/grantRolesToUser.md): Grant additional roles to a user in MongoDB using the `grantRolesToUser` command, specifying roles, write concern, and optional comments. - [hello (database command)](https://www.mongodb.com/docs/manual/reference/command/hello.md): Use the `hello` command to determine the role and status of a `mongod` instance, including replica set information and SASL mechanisms. - [hostInfo (database command)](https://www.mongodb.com/docs/manual/reference/command/hostInfo.md): Retrieve system information for `mongod` or `mongos` using the `hostInfo` command, which provides details about the underlying environment and hardware. - [insert (database command)](https://www.mongodb.com/docs/manual/reference/command/insert.md): Use the insert database command to add one or more documents to a collection. Includes syntax, command fields, behavior, examples, and output reference. - [invalidateUserCache (database command)](https://www.mongodb.com/docs/manual/reference/command/invalidateUserCache.md): Use the `invalidateUserCache` command to flush user information from the in-memory cache, removing credentials and roles immediately. - [isdbgrid (database command)](https://www.mongodb.com/docs/manual/reference/command/isdbgrid.md): Verify if a process is a `mongos` using the `isdbgrid` command, which returns a specific response when connected to a `mongos`. - [killAllSessions (database command)](https://www.mongodb.com/docs/manual/reference/command/killAllSessions.md): Terminate all sessions for specified users using the `killAllSessions` command in MongoDB. - [killAllSessionsByPattern (database command)](https://www.mongodb.com/docs/manual/reference/command/killAllSessionsByPattern.md): Terminate sessions in MongoDB that match specified patterns, with options for user, role, and session ID criteria. - [killCursors (database command)](https://www.mongodb.com/docs/manual/reference/command/killCursors.md): Execute the `killCursors` command to terminate specified cursors in a collection, typically managed automatically by MongoDB drivers. - [killOp (database command)](https://www.mongodb.com/docs/manual/reference/command/killOp.md): Terminate operations using the `killOp` command by specifying the operation ID, with support across various MongoDB environments. - [killSessions (database command)](https://www.mongodb.com/docs/manual/reference/command/killSessions.md): Terminate specified sessions using the `killSessions` command, which affects in-progress operations and ignores sessions with transactions in prepared state. - [listCollections (database command)](https://www.mongodb.com/docs/manual/reference/command/listCollections.md): Retrieve information about collections and views in a database using the listCollections command, including names, creation options, and filter criteria. - [listCommands (database command)](https://www.mongodb.com/docs/manual/reference/command/listCommands.md): Generate a list of all database commands available for the current `mongod` or `mongos` instance using the `listCommands` command. - [listDatabases (database command)](https://www.mongodb.com/docs/manual/reference/command/listDatabases.md): Retrieve an unsorted list of all databases and their statistics using the listDatabases command, with options for filtering by name, size, or access control. - [listIndexes (database command)](https://www.mongodb.com/docs/manual/reference/command/listIndexes.md): Use the listIndexes database command to retrieve information about all indexes on a collection, including index keys, options, and cursor batch size settings. - [listShards (database command)](https://www.mongodb.com/docs/manual/reference/command/listShards.md): Retrieve a list of configured shards in a sharded cluster using the `listShards` command on `mongos` instances. - [lockInfo (database command)](https://www.mongodb.com/docs/manual/reference/command/lockInfo.md): Retrieve information on current locks held or pending on `mongod` instances using the `lockInfo` command. - [logApplicationMessage (database command)](https://www.mongodb.com/docs/manual/reference/command/logApplicationMessage.md): Post custom messages to the audit log using the `logApplicationMessage` command, requiring `clusterAdmin` role for authorization. - [logRotate (database command)](https://www.mongodb.com/docs/manual/reference/command/logRotate.md): Rotate MongoDB server and audit logs to manage disk space using the `logRotate` command. - [logout (database command)](https://www.mongodb.com/docs/manual/reference/command/logout.md): Understand the deprecated `logout` command in MongoDB, which is replaced by closing the connection. - [mapReduce (database command)](https://www.mongodb.com/docs/manual/reference/command/mapReduce.md): Explore alternatives to the deprecated map-reduce in MongoDB, focusing on using aggregation pipelines for better performance and usability. Includes syntax, fields, and output reference. - [mergeAllChunksOnShard (database command)](https://www.mongodb.com/docs/manual/reference/command/mergeAllChunksOnShard.md): Execute the `mergeAllChunksOnShard` command to merge all mergeable chunks on a specified shard for a given collection in MongoDB. - [mergeChunks (database command)](https://www.mongodb.com/docs/manual/reference/command/mergeChunks.md): Combine contiguous chunk ranges on a shard into a single chunk using the `mergeChunks` command for sharded collections. - [moveChunk (database command)](https://www.mongodb.com/docs/manual/reference/command/moveChunk.md): Move chunks between shards using the `moveChunk` command in MongoDB, specifying options like destination shard and write concern. - [moveCollection (database command)](https://www.mongodb.com/docs/manual/reference/command/moveCollection.md) - [movePrimary (database command)](https://www.mongodb.com/docs/manual/reference/command/movePrimary.md): Reassign the primary shard for un-sharded collections in a database using the `movePrimary` command in a sharded cluster. - [moveRange (database command)](https://www.mongodb.com/docs/manual/reference/command/moveRange.md): Execute the `moveRange` command to transfer data ranges between shards in MongoDB, specifying parameters like `min`, `max`, and `toShard`. - [ping (database command)](https://www.mongodb.com/docs/manual/reference/command/ping.md): Use the `ping` command to test server responsiveness in MongoDB environments, including Atlas, Enterprise, and Community versions. - [planCacheClear (database command)](https://www.mongodb.com/docs/manual/reference/command/planCacheClear.md): Clear cached query plans for a collection using the `planCacheClear` command, specifying a query shape or clearing all plans. - [planCacheClearFilters (database command)](https://www.mongodb.com/docs/manual/reference/command/planCacheClearFilters.md): Remove index filters from a collection using the `planCacheClearFilters` command, with options to clear specific or all filters. - [planCacheListFilters (database command)](https://www.mongodb.com/docs/manual/reference/command/planCacheListFilters.md): List index filters for plan cache query shapes in a collection, noting that index filters are deprecated in MongoDB 8.0. - [planCacheSetFilter (database command)](https://www.mongodb.com/docs/manual/reference/command/planCacheSetFilter.md): Set an index filter for a collection to optimize query planning, with examples for different query shapes and compatibility details. - [profile (database command)](https://www.mongodb.com/docs/manual/reference/command/profile.md): Configure the database profiler in MongoDB to capture performance data on operations, with options for filtering and logging slow operations. - [reIndex (database command)](https://www.mongodb.com/docs/manual/reference/command/reIndex.md): Run the `reIndex` command to drop and recreate all indexes on a collection, available only on standalone instances. - [refineCollectionShardKey (database command)](https://www.mongodb.com/docs/manual/reference/command/refineCollectionShardKey.md): Modify a collection's shard key by adding new fields to address jumbo chunks, ensuring the new key is supported by an existing index. - [refreshSessions (database command)](https://www.mongodb.com/docs/manual/reference/command/refreshSessions.md): Use the `refreshSessions` command to update the last use time for specified sessions, extending their active state in MongoDB environments. - [removeQuerySettings (database command)](https://www.mongodb.com/docs/manual/reference/command/removeQuerySettings.md) - [removeShard (database command)](https://www.mongodb.com/docs/manual/reference/command/removeShard.md): Remove a shard from a sharded cluster by draining its chunks to other shards using the balancer, ensuring no backups during the process. - [removeShardFromZone (database command)](https://www.mongodb.com/docs/manual/reference/command/removeShardFromZone.md): Remove the association between a shard and a zone using the `removeShardFromZone` command in MongoDB. - [renameCollection (database command)](https://www.mongodb.com/docs/manual/reference/command/renameCollection.md): Rename an existing collection in MongoDB using the renameCollection command, specifying the source and target namespaces, with options to set write concerns. - [replSetAbortPrimaryCatchUp (database command)](https://www.mongodb.com/docs/manual/reference/command/replSetAbortPrimaryCatchUp.md): Force the elected primary in a replica set to abort sync and complete the transition to primary using the `replSetAbortPrimaryCatchUp` command. - [replSetFreeze (database command)](https://www.mongodb.com/docs/manual/reference/command/replSetFreeze.md): Prevent a replica set member from seeking election for a specified time using the `replSetFreeze` command. - [replSetGetConfig (database command)](https://www.mongodb.com/docs/manual/reference/command/replSetGetConfig.md): Retrieve the current configuration of a replica set using the `replSetGetConfig` command, with options for additional fields like commitment status. - [replSetGetStatus (database command)](https://www.mongodb.com/docs/manual/reference/command/replSetGetStatus.md): Retrieve the status of a replica set using the `replSetGetStatus` command, which provides detailed information about the replica set's state and members. - [replSetInitiate (database command)](https://www.mongodb.com/docs/manual/reference/command/replSetInitiate.md): Initialize a new replica set using the `replSetInitiate` command or `rs.initiate()` method, specifying configuration with DNS hostnames. - [replSetMaintenance (database command)](https://www.mongodb.com/docs/manual/reference/command/replSetMaintenance.md): Enable or disable maintenance mode for a secondary member of a replica set using the `replSetMaintenance` command. - [replSetReconfig (database command)](https://www.mongodb.com/docs/manual/reference/command/replSetReconfig.md): Modify replica set configurations using the `replSetReconfig` command to add or remove members and alter options on existing members. - [replSetResizeOplog (database command)](https://www.mongodb.com/docs/manual/reference/command/replSetResizeOplog.md): Resize the oplog or adjust its retention period dynamically using the `replSetResizeOplog` command without restarting `mongod`. - [replSetStepDown (database command)](https://www.mongodb.com/docs/manual/reference/command/replSetStepDown.md): Use the replSetStepDown database command to step down a replica set primary to secondary. Accepts stepdown duration and an optional force step-down parameter. - [replSetSyncFrom (database command)](https://www.mongodb.com/docs/manual/reference/command/replSetSyncFrom.md): Override the default sync target for a `mongod` instance temporarily using `replSetSyncFrom` to test replication patterns. - [reshardCollection (database command)](https://www.mongodb.com/docs/manual/reference/command/reshardCollection.md): Change the shard key and data distribution of a collection using the `reshardCollection` command, with options for zones and forced redistribution. - [revokePrivilegesFromRole (database command)](https://www.mongodb.com/docs/manual/reference/command/revokePrivilegesFromRole.md): Remove specified privileges from a user-defined role using the `revokePrivilegesFromRole` command in MongoDB. - [revokeRolesFromRole (database command)](https://www.mongodb.com/docs/manual/reference/command/revokeRolesFromRole.md): Remove specified inherited roles from a role using the `revokeRolesFromRole` command in MongoDB. - [revokeRolesFromUser (database command)](https://www.mongodb.com/docs/manual/reference/command/revokeRolesFromUser.md): Remove roles from a user in MongoDB using the `revokeRolesFromUser` command, specifying roles and optional write concern. - [rewriteCollection (database command)](https://www.mongodb.com/docs/manual/reference/command/rewriteCollection.md): Change the data distribution of a collection using the `rewriteCollection` command. - [rolesInfo (database command)](https://www.mongodb.com/docs/manual/reference/command/rolesInfo.md): Retrieve inheritance and privilege information for specified roles using the `rolesInfo` command, including user-defined and built-in roles. - [rotateCertificates (database command)](https://www.mongodb.com/docs/manual/reference/command/rotateCertificates.md): Rotate TLS certificates for `mongod` or `mongos` using the `rotateCertificates` command, ensuring updated values are defined in the configuration file. - [serverStatus (database command)](https://www.mongodb.com/docs/manual/reference/command/serverStatus.md): Retrieve an overview of the database state, query, index, and operation statistics, and the health of the MongoDB instance by running the serverStatus command. - [setAllowMigrations (database command)](https://www.mongodb.com/docs/manual/reference/command/setAllowMigrations.md): Prevent or allow migrations on a collection using the `setAllowMigrations` command in MongoDB. - [setAuditConfig (database command)](https://www.mongodb.com/docs/manual/reference/command/setAuditConfig.md): Configure audit settings for `mongod` and `mongos` instances using the deprecated `setAuditConfig` command. - [setClusterParameter (database command)](https://www.mongodb.com/docs/manual/reference/command/setClusterParameter.md): Modify cluster parameters across all nodes in a replica set or sharded cluster using the `setClusterParameter` command. - [setDefaultRWConcern (database command)](https://www.mongodb.com/docs/manual/reference/command/setDefaultRWConcern.md): Configure global default read and write concerns for replica sets or sharded clusters using the `setDefaultRWConcern` command. - [setFeatureCompatibilityVersion (database command)](https://www.mongodb.com/docs/manual/reference/command/setFeatureCompatibilityVersion.md): Configure MongoDB to enable or disable backwards-incompatible features using setFeatureCompatibilityVersion, which controls data persistence compatibility across versions. - [setIndexCommitQuorum (database command)](https://www.mongodb.com/docs/manual/reference/command/setIndexCommitQuorum.md): Set the minimum number of data-bearing members required to commit index builds before the primary node marks the index as ready. - [setParameter (database command)](https://www.mongodb.com/docs/manual/reference/command/setParameter.md): Modify server options with the `setParameter` command, which must be issued against the admin database and does not persist after server restarts. - [setQuerySettings (database command)](https://www.mongodb.com/docs/manual/reference/command/setQuerySettings.md): Use the `setQuerySettings` command to set persistent query settings, such as index hints and operation rejection filters, for all `find`, `distinct`, and `aggregate` commands on a cluster. - [setUserWriteBlockMode (database command)](https://www.mongodb.com/docs/manual/reference/command/setUserWriteBlockMode.md): Block or unblock writes to a cluster using the `setUserWriteBlockMode` command, with bypass privileges available. - [shardCollection (database command)](https://www.mongodb.com/docs/manual/reference/command/shardCollection.md): Distribute documents across shards using the `shardCollection` command, specifying shard keys and optional parameters for initial chunk distribution. - [shardConnPoolStats (database command)](https://www.mongodb.com/docs/manual/reference/command/shardConnPoolStats.md): Explore the shardConnPoolStats command, which provides details on pooled and cached connections in a sharded cluster, including connection cache information. - [shardDrainingStatus (database command)](https://www.mongodb.com/docs/manual/reference/command/shardDrainingStatus.md): How to use shardDrainingStatus to get the status of the draining operation being performed on the shard. - [shardingState (database command)](https://www.mongodb.com/docs/manual/reference/command/shardingState.md): Determine if a `mongod` instance is part of a sharded cluster using the `shardingState` command. - [shutdown (database command)](https://www.mongodb.com/docs/manual/reference/command/shutdown.md): Terminate MongoDB processes using the `shutdown` command, which cleans up resources and requires execution against the admin database. - [split (database command)](https://www.mongodb.com/docs/manual/reference/command/split.md): Split chunks in a sharded cluster using the `split` command, which allows manual chunk division based on specified criteria like `find`, `middle`, or `bounds`. - [startSession (database command)](https://www.mongodb.com/docs/manual/reference/command/startSession.md): Initiate a new logical session for operations using the `startSession` command in MongoDB. - [startShardDraining (database command)](https://www.mongodb.com/docs/manual/reference/command/startShardDraining.md): Starts draining chunks from a shard in a sharded cluster using the balancer. - [startTransitionToDedicatedConfigServer (database command)](https://www.mongodb.com/docs/manual/reference/command/startTransitionToDedicatedConfigServer.md): Starts the transition from an embedded config server to a dedicated config server. - [stopShardDraining (database command)](https://www.mongodb.com/docs/manual/reference/command/stopShardDraining.md): Stops the balancer from draining chunks from the given shard. The shard resumes its role in the sharded cluster and is included in rebalancing operations. - [stopTransitionToDedicatedConfigServer (database command)](https://www.mongodb.com/docs/manual/reference/command/stopTransitionToDedicatedConfigServer.md): Stops the in-progress transition from an embedded config server to a dedicated config server. - [top (database command)](https://www.mongodb.com/docs/manual/reference/command/top.md): Retrieve usage statistics for collections using the `top` command, which provides metrics on read and write operations. - [transitionFromDedicatedConfigServer (database command)](https://www.mongodb.com/docs/manual/reference/command/transitionFromDedicatedConfigServer.md)