Table of Contents

Method GetValue

Namespace
MongoDB.Bson
Assembly
MongoDB.Bson.dll

GetValue(int)

Gets the value of an element.

public virtual BsonValue GetValue(int index)

Parameters

index int

The zero based index of the element.

Returns

BsonValue

The value of the element.

GetValue(string)

Gets the value of an element.

public virtual BsonValue GetValue(string name)

Parameters

name string

The name of the element.

Returns

BsonValue

The value of the element.

GetValue(string, BsonValue)

Gets the value of an element or a default value if the element is not found.

public virtual BsonValue GetValue(string name, BsonValue defaultValue)

Parameters

name string

The name of the element.

defaultValue BsonValue

The default value returned if the element is not found.

Returns

BsonValue

The value of the element or the default value if the element is not found.