Docs HomeMongoDB Manual

Administration Commands管理命令

Note

For details on a specific command, including syntax and examples, click on the link to the command's reference page.有关特定命令的详细信息,包括语法和示例,请单击该命令参考页的链接。

Name名称Description描述
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.对集合进行分片整理并重新构建索引。
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.返回使用GridFS存储的文件的md5哈希。
fsyncFlushes pending writes to the storage layer and locks the database to allow backups.刷新对存储层的挂起写入并锁定数据库以允许备份。
fsyncUnlockUnlocks one fsync lock.解锁一个fsync锁。
getDefaultRWConcernRetrieves the global default read and write concern options for the deployment. 检索部署的全局默认读写入关注选项。
New in version 4.4. 4.4版新增。
getAuditConfigRetrieves details on audit configuration and filters.检索有关审核配置和筛选器的详细信息。
New in version 5.0. 5.0版新增。
getClusterParameterRetrieves cluster parameter values from all nodes in a cluster. 从群集中的所有节点检索群集参数值。
New in version 6.0. 6.0版新增。
getParameterRetrieves configuration options.检索配置选项。
killCursorsKills the specified cursors for a collection.杀死集合的指定游标。
killOpTerminates an operation as specified by the operation ID.根据操作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.旋转MongoDB日志以防止单个文件占用太多空间。
reIndexRebuilds all indexes on a collection.重新生成集合上的所有索引。
renameCollectionChanges the name of an existing collection.更改现有集合的名称。
rotateCertificatesPerforms online TLS certificate rotation.执行联机TLS证书轮换。
setFeatureCompatibilityVersionEnables or disables features that persist data that are backwards-incompatible.启用或禁用保持向后不兼容的数据的功能。
setIndexCommitQuorumChanges the minimum number of data-bearing members (i.e commit quorum), including the primary, that must vote to commit an in-progress index build before the primary marks those indexes as ready.更改数据承载成员(即提交法定人数)的最小数量,包括主要成员,在主要成员将这些索引标记为就绪之前,这些成员必须投票提交正在进行的索引生成
setClusterParameterModifies configuration options for all nodes in a cluster. 修改群集中所有节点的配置选项。
New in version 6.0. 6.0版新增。
setParameterModifies configuration options.修改配置选项。
setDefaultRWConcernSets the global default read and write concern options for the deployment. 设置部署的全局默认读写入关注选项。
New in version 4.4. 4.4版新增。
shutdownShuts down the mongod or mongos process.关闭mongodmongos进程。