- Reference >
- JavaScript Methods >
- db.runCommand()
db.runCommand()¶
-
db.
runCommand
(command)¶ Parameters: - command (string) – Specifies a database command in the form of a document.
- command – When specifying a command as a string,
db.runCommand()
transforms the command into the form{ command: 1 }
.
Provides a helper to run specified database commands. This is the preferred method to issue database commands, as it provides a consistent interface between the shell and drivers.