Click or drag to resize

BsonDocumentGetValue Method (String, BsonValue)

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

Namespace:  MongoDB.Bson
Assembly:  MongoDB.Bson (in MongoDB.Bson.dll) Version: 2.6.0+Branch.origin/v2.6.x.Sha.593796a7b35dc59243383bcc684de296a5468f2e
Syntax
public virtual BsonValue GetValue(
	string name,
	BsonValue defaultValue
)

Parameters

name
Type: SystemString
The name of the element.
defaultValue
Type: MongoDB.BsonBsonValue
The default value returned if the element is not found.

Return Value

Type: BsonValue
The value of the element or the default value if the element is not found.
See Also