Databases Reference
In-Depth Information
findAndModify
See
Chapter 3
for a full reference on using the
findAndModify
command.
getLastError
{"getLastError" : 1[, "w" :
w
[, "wtimeout" :
timeout
]]}
Checks for errors or other status information about the last operation performed
on this connection. The command will optionally block until
w
slaves have repli-
cated the last operation on this connection (or until
timeout
milliseconds have gone
by).
isMaster
{"isMaster" : 1}
Checks if this server is a master or slave.
listCommands
{"listCommands" : 1}
Returns a list of all database commands available on this server, as well as some
information about each command.
listDatabases
{"listDatabases" : 1}
Admin-only command listing all databases on this server.
ping
{"ping" : 1}
Checks if a server is alive. This command will return immediately even if the server
is in a lock.
renameCollection
{"renameCollection" :
a
, "to" :
b
}
Renames collection
a
to
b
, where both
a
and
b
are
full collection namespaces
(e.g.,
"foo.bar"
for the collection
bar
in the
foo
database).
repairDatabase
{"repairDatabase" : 1}
Repairs and compacts the current database, which can be a long-running opera-
tion. See
“Repair” on page 124
for more information.
serverStatus
{"serverStatus" : 1}
Gets administrative statistics for this server. See
“Monitoring” on page 114
for
more information.