Method SetElement
SetElement(int, BsonElement)
Sets an element of the document (replacing the existing element at that position).
public virtual BsonDocument SetElement(int index, BsonElement element)
Parameters
index
intThe zero based index of the element to replace.
element
BsonElementThe new element.
Returns
- BsonDocument
The document.
SetElement(BsonElement)
Sets an element of the document (replaces any existing element with the same name or adds a new element if an element with the same name is not found).
public virtual BsonDocument SetElement(BsonElement element)
Parameters
element
BsonElementThe new element.
Returns
- BsonDocument
The document.