On this page本页内容
All command documentation outlined below describes a command and its available parameters and provides a document template or prototype for each command. 下面列出的所有命令文档都描述了一个命令及其可用参数,并为每个命令提供了一个文档模板或原型。Some command documentation also includes the relevant 一些命令文档还包括相关的mongo
shell helpers.mongo
shell助手。
To run a command against the current database, use 要对当前数据库运行命令,请使用db.runCommand()
:db.runCommand()
:
To run an administrative command against the 要对admin
database, use db.adminCommand()
:admin
数据库运行管理命令,请使用db.adminCommand()
:
Note
For details on specific commands, including syntax and examples, click on the specific command to go to its reference page.有关特定命令的详细信息,包括语法和示例,请单击特定命令以转到其参考页面。
aggregate |
|
count |
|
distinct |
|
mapReduce |
geoSearch |
delete |
|
find |
|
findAndModify |
|
getLastError |
|
getMore |
|
insert |
|
resetError |
|
update |
planCacheClear |
|
planCacheClearFilters |
|
planCacheListFilters |
|
planCacheSetFilter |
authenticate |
|
getnonce |
|
logout |
createUser |
|
dropAllUsersFromDatabase |
|
dropUser |
|
grantRolesToUser |
|
revokeRolesFromUser |
|
updateUser |
|
usersInfo |
createRole |
|
dropRole |
|
dropAllRolesFromDatabase |
|
grantPrivilegesToRole |
|
grantRolesToRole |
|
invalidateUserCache |
|
revokePrivilegesFromRole |
|
revokeRolesFromRole |
|
rolesInfo |
|
updateRole |
applyOps |
|
isMaster |
|
replSetAbortPrimaryCatchUp |
|
replSetFreeze |
|
replSetGetConfig |
|
replSetGetStatus |
|
replSetInitiate |
|
replSetMaintenance |
RECOVERING state.RECOVERING (恢复)状态。 |
replSetReconfig |
|
replSetResizeOplog |
|
replSetStepDown |
|
replSetSyncFrom |
See also参阅
Replication for more information regarding replication.复制以获取有关复制的更多信息。
addShard |
|
addShardToZone |
|
balancerCollectionStatus |
|
balancerStart |
|
balancerStatus |
|
balancerStop |
|
checkShardingIndex |
|
clearJumboFlag |
jumbo flag for a chunk.jumbo 标志。 |
cleanupOrphaned |
|
enableSharding |
|
flushRouterConfig |
mongod /mongos instance to update its cached routing metadata.mongod /mongos 实例更新其缓存的路由元数据。 |
getShardMap |
|
getShardVersion |
|
isdbgrid |
mongos .mongos 。 |
listShards |
|
medianKey |
splitVector .splitVector 。 |
moveChunk |
|
movePrimary |
|
mergeChunks |
|
refineCollectionShardKey |
|
removeShard |
|
removeShardFromZone |
|
setShardVersion |
|
shardCollection |
|
shardingState |
mongod is a member of a sharded cluster.mongod 是否为分片群集的成员。 |
split |
|
splitChunk |
sh.splitFind() and sh.splitAt() .sh.splitFind() 方法和sh.splitAt() 方法。 |
splitVector |
|
unsetSharding |
|
updateZoneKeyRange |
abortTransaction |
|
commitTransaction |
|
endSessions |
|
killAllSessions |
|
killAllSessionsByPattern |
|
killSessions |
|
refreshSessions |
|
startSession |
|
cloneCollectionAsCapped |
|
collMod |
|
compact |
|
connPoolSync |
|
convertToCapped |
|
create |
|
createIndexes |
|
currentOp |
|
drop |
|
dropDatabase |
|
dropConnections |
|
dropIndexes |
|
filemd5 |
|
fsync |
|
fsyncUnlock |
|
getDefaultRWConcern |
|
getParameter |
|
killCursors |
|
killOp |
|
listCollections |
|
listDatabases |
|
listIndexes |
|
logRotate |
|
reIndex |
|
renameCollection |
|
setFeatureCompatibilityVersion |
|
setIndexCommitQuorum |
|
setParameter |
|
setDefaultRWConcern |
|
shutdown |
mongod or mongos process.mongod 或mongos 进程。 |
availableQueryOptions |
|
buildInfo |
|
collStats |
|
connPoolStats |
|
connectionStatus |
|
cursorInfo |
metrics.cursor .metrics.cursor 所取代。 |
dataSize |
|
dbHash |
|
dbStats |
|
driverOIDTest |
|
explain |
|
features |
|
getCmdLineOpts |
|
getLog |
|
hostInfo |
|
isSelf |
|
listCommands |
mongod instance.mongod 实例提供的所有数据库命令。 |
lockInfo |
mongod instances.mongod 实例。 |
netstat |
mongos instances.mongos 实例。 |
ping |
|
profile |
|
serverStatus |
|
shardConnPoolStats |
|
top |
mongod instance.mongod 实例中每个数据库的原始使用统计信息。 |
validate |
|
whatsmyuri |
setFreeMonitoring |
logApplicationMessage |