db.runCommand() runs the command in the context of the
current database. Some commands are only applicable in the context of
admin database, and you must change your
db object to
before running these commands or use
The method returns a response document that contains the following fields:
Result fields specific to the
A number that indicates whether the command has succeeded (
The logical time of the operation. MongoDB uses the logical time to order operations. Only for replica sets and sharded clusters.
If the command does not generate an oplog entry, e.g. a read
operation, then the operation does not advance the logical
clock. In this case,
A document that returns the signed cluster time. Cluster time is a logical time used for ordering of operations. Only for replica sets and sharded clusters. For internal use only.
The document contains the following fields: