Table of Contents

Method Set

Namespace
MongoDB.Bson
Assembly
MongoDB.Bson.dll

Set(int, BsonValue)

Sets the value of an element.

public override BsonDocument Set(int index, BsonValue value)

Parameters

index int

The zero based index of the element whose value is to be set.

value BsonValue

The new value.

Returns

BsonDocument

The document (so method calls can be chained).

Set(string, BsonValue)

Sets the value of an element (an element will be added if no element with this name is found).

public override BsonDocument Set(string name, BsonValue value)

Parameters

name string

The name of the element whose value is to be set.

value BsonValue

The new value.

Returns

BsonDocument

The document (so method calls can be chained).