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
commandIMongoCommandThe command object.
Returns
- TCommandResult
A TCommandResult
Type Parameters
TCommandResultThe 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
commandIMongoCommandThe command object.
readPreferenceReadPreferenceThe read preference.
Returns
- TCommandResult
A TCommandResult
Type Parameters
TCommandResultThe 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
commandNamestringThe name of the command.
Returns
- TCommandResult
A TCommandResult
Type Parameters
TCommandResultThe 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
commandResultTypeTypeThe command result type.
commandIMongoCommandThe 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