runCommand

inline suspend fun <TResult : Any> MongoDatabase.runCommand(command: String, readPreference: ReadPreference): TResult

Executes the given command in the context of the current database with the given read preference.

Parameters

command

the command to be run

readPreference

the {@link com.mongodb.ReadPreference} to be used when executing the command

the type of the class to use instead of {@code Document}.

inline suspend fun <TResult : Any> MongoDatabase.runCommand(command: String): TResult

Executes the given command in the context of the current database with the given read preference.

Parameters

command

the command to be run

the type of the class to use instead of {@code Document}.

inline suspend fun <TResult : Any> MongoDatabase.runCommand(clientSession: ClientSession, command: String, readPreference: ReadPreference): TResult

Executes the given command in the context of the current database with the given read preference.

Parameters

clientSession

the client session with which to associate this operation

command

the command to be run

readPreference

the {@link com.mongodb.ReadPreference} to be used when executing the command

the type of the class to use instead of {@code Document}.

inline suspend fun <TResult : Any> MongoDatabase.runCommand(clientSession: ClientSession, command: String): TResult

Executes the given command in the context of the current database with the given read preference.

Parameters

clientSession

the client session with which to associate this operation

command

the command to be run

the type of the class to use instead of {@code Document}.