Method Add
Add(BsonElement)
Adds an element to the document.
public override BsonDocument Add(BsonElement element)
Parameters
element
BsonElementThe element to add.
Returns
- BsonDocument
The document (so method calls can be chained).
Add(string, BsonValue)
Creates and adds an element to the document.
public override BsonDocument Add(string name, BsonValue value)
Parameters
Returns
- BsonDocument
The document (so method calls can be chained).
Add(string, BsonValue, bool)
Creates and adds an element to the document, but only if the condition is true.
public override BsonDocument Add(string name, BsonValue value, bool condition)
Parameters
name
stringThe name of the element.
value
BsonValueThe value of the element.
condition
boolWhether to add the element to the document.
Returns
- BsonDocument
The document (so method calls can be chained).