80. //获取支持的所有命令信息 ListCommandsCmd获取所有支持的命令 db.listCommands() 81. static const CommandMap& allCommands() { 82. return *_commands; 83. } 84. 85. //没用 86. static const CommandMap& allCommandsByBestName() { 87. return *_commandsByBestName; 88. } 89. 90. //收...
1.在shell中运行db.listCommands() 2.在浏览器中访问管理员接口:http://ipaddress:28017/_commands 下面介绍在Mongodb中最经常使用的命令,具体如下: 命令:buildInfo 格式:{"buildInfo":1} 介绍:管理专用命令,返回Mongodb服务器的版本号和主机的操作系统。 示例: Shell代码 > db.runCommand({"buildInfo":1})...
dbcommands_admin.cpp:管理指令,如CleanCmd,JournalLatencyTestCmd,ValidateCmd,FSyncCommand dbcommands_generic.cpp:常用指令,ListCommandsCmd,LogRotateCmd,PingCommand,CmdSet,CmdGet等 replset_commands.cpp:复制集指令,CmdReplSetTest,CmdReplSetGetStatus,CmdReplSetReconfig等 security_commands.cpp:安全指令,CmdGetNo...
listCommands命令生成为当前mongod或mongos实例实施的所有数据库命令的列表。 兼容性 此命令可用于以下环境中托管的部署: MongoDB Atlas:用于云中 MongoDB 部署的完全托管服务 注意 所有MongoDB Atlas 集群都支持此命令。有关 Atlas 对所有命令的支持的信息,请参阅不支持的命令。
listCommands() lists all the db commands db.loadServerScripts() loads all the myscripts in db.system.js db.logout() db.printCollectionStats() db.printReplicationInfo() db.printShardingStatus() db.printSlaveReplicationInfo() db.resetError() db.runCommand(cmdObj) run a database command. if...
db.listCommands() // lists all the db commands db.loadServerScripts() // loads all the scripts in db.system.js db.logout() db.printCollectionStats() // 返回当前库的数据集状态 db.printReplicationInfo() // 打印主数据库的复制状态信息 ...
在Shell中通过db.listCommands(),来看当前MongoDB支持的所有命令(同样可通过运行命令db.runCommand({"listCommands" : `1})来查询所有命令)。我们说几个常用的命令: 1》 db.runCommand({"buildInfo" : 1}):返回MongoDB服务器的版本号和服务器OS的相关信息。
db.listCommands() 提供所有数据库命令的列表。 db.logout() 结束已经过身份验证的会话。 db.printShardingStatus() 打印分片配置的格式化报告以及有关分片集群中现有数据段的信息。 db.runCommand() 运行数据库命令。 db.setLogLevel() 为日志消息设置单一的详细程度。 db.setProfilingLevel() 配置数据库分析器级...
listCommands() lists all the db commands db.loadServerScripts() loads all the scripts in db.system.js db.logout() db.printCollectionStats() db.printReplicationInfo() db.printShardingStatus() db.printSlaveReplicationInfo() db.dropUser(username) db.repairDatabase() db.resetError() db....
本节会更深入地介绍数据库命令,一起来看看这些数据库命令到底是什么,到底是怎么实现的。本节也会介绍MongoDB提供的一些非常有用的命令。在shell中运行db.listCommands()可以看到所有的数据库命令。 数据库命令工作原理 数据库命令总会返回一个包含"ok"键的文档。如果"ok"的值是1,说明命令执行成功了;如果值是0,说...