suspend fun <reified TResult> runCommand(command: Bson, readPreference: ReadPreference = this.readPreference): TResult?
(source)
Executes command in the context of the current database.
command
- the command to be run
readPreference
- the com.mongodb.ReadPreference to be used when executing the command
Parameters
Return
a publisher containing the command result
suspend fun <reified TResult> runCommand(clientSession: ClientSession, command: Bson, readPreference: ReadPreference = this.readPreference): TResult?
(source)
Executes command in the context of the current database.
clientSession
- the client session with which to associate this operation
command
- the command to be run
readPreference
- the com.mongodb.ReadPreference to be used when executing the command
Parameters
Return
a publisher containing the command result
suspend fun <reified TResult : Any> runCommand(command: String, newReadPreference: ReadPreference = readPreference): TResult?
(source)
Executes the given command in the context of the current database with the given read preference.
command
- the command to be run
newReadPreference
- the {@link com.mongodb.ReadPreference} to be used when executing the command
Parameters