Function MongoConnection.runCommand
Runs the given Bson command (Bson object with the first entry in the map being the command name) on the given database.
Using runCommand
checks that the command completed successfully by
checking that result["ok"]
. Throws the
CommandFailException
on failure.
Using runCommandUnchecked
will return the result as-is. Developers may
check the result["ok"]
value themselves. (It's a double that needs to
be compared with 1.0 by default)
Throws
- CommandFailException
(template argument) only in the
runCommand
overload, when the command response is not ok.
- MongoDriverException
when internal protocol errors occur.