Table of Contents

Class CommandResult

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.Legacy.dll

Represents the result of a command (there are also subclasses for various commands).

[Serializable]
[BsonSerializer(typeof(CommandResultSerializer<CommandResult>))]
public class CommandResult
Inheritance
CommandResult
Derived
Inherited Members
Extension Methods

Constructors

CommandResult(BsonDocument)

Initializes a new instance of the CommandResult class.

public CommandResult(BsonDocument response)

Parameters

response BsonDocument

The response.

Properties

Code

Gets the code.

public int? Code { get; }

Property Value

int?

ErrorMessage

Gets the error message (null if none).

public string ErrorMessage { get; }

Property Value

string

Ok

Gets the Ok value from the response.

public bool Ok { get; }

Property Value

bool

Response

Gets the response.

public BsonDocument Response { get; }

Property Value

BsonDocument