Method RunCommandAs
RunCommandAs<TCommandResult>(IMongoCommand)
Runs a command on this database and returns the result as a TCommandResult.
public virtual TCommandResult RunCommandAs<TCommandResult>(IMongoCommand command) where TCommandResult : CommandResult
Parameters
command
IMongoCommandThe command object.
Returns
- TCommandResult
A TCommandResult
Type Parameters
TCommandResult
The type of the returned command result.
RunCommandAs<TCommandResult>(IMongoCommand, ReadPreference)
Runs a command on this database and returns the result as a TCommandResult.
public TCommandResult RunCommandAs<TCommandResult>(IMongoCommand command, ReadPreference readPreference) where TCommandResult : CommandResult
Parameters
command
IMongoCommandThe command object.
readPreference
ReadPreferenceThe read preference.
Returns
- TCommandResult
A TCommandResult
Type Parameters
TCommandResult
The type of the returned command result.
RunCommandAs<TCommandResult>(string)
Runs a command on this database and returns the result as a TCommandResult.
public virtual TCommandResult RunCommandAs<TCommandResult>(string commandName) where TCommandResult : CommandResult
Parameters
commandName
stringThe name of the command.
Returns
- TCommandResult
A TCommandResult
Type Parameters
TCommandResult
The type of the returned command result.
RunCommandAs(Type, IMongoCommand)
Runs a command on this database and returns the result as a TCommandResult.
public virtual CommandResult RunCommandAs(Type commandResultType, IMongoCommand command)
Parameters
commandResultType
TypeThe command result type.
command
IMongoCommandThe command object.
Returns
- CommandResult
A TCommandResult
RunCommandAs(Type, string)
Runs a command on this database and returns the result as a TCommandResult.
public virtual CommandResult RunCommandAs(Type commandResultType, string commandName)
Parameters
Returns
- CommandResult
A TCommandResult