Constructor BsonDocument
BsonDocument()
Initializes a new instance of the BsonDocument class.
BsonDocument(bool)
Initializes a new instance of the BsonDocument class specifying whether duplicate element names are allowed (allowing duplicate element names is not recommended).
Parameters
allowDuplicateNames
boolWhether duplicate element names are allowed.
BsonDocument(BsonElement)
Initializes a new instance of the BsonDocument class and adds one element.
Parameters
element
BsonElement An element to add to the document.
BsonDocument(BsonDocument)
Initializes a new instance of the BsonDocument by coping elements from another BsonDocument.
Parameters
document
BsonDocument The document whose elements will be copied
BsonDocument(Dictionary<string, object>)
Initializes a new instance of the BsonDocument class and adds new elements from a dictionary of key/value pairs.
Parameters
dictionary
Dictionary<string, object>A dictionary to initialize the document from.
BsonDocument(IEnumerable<KeyValuePair<string, object>>)
Initializes a new instance of the BsonDocument class and adds new elements from a dictionary of key/value pairs.
Parameters
dictionary
IEnumerable<KeyValue <string, object>>Pair A dictionary to initialize the document from.
BsonDocument(IDictionary)
Initializes a new instance of the BsonDocument class and adds new elements from a dictionary of key/value pairs.
Parameters
dictionary
IDictionaryA dictionary to initialize the document from.
BsonDocument(IEnumerable<BsonElement>)
Initializes a new instance of the BsonDocument class and adds new elements from a list of elements.
Parameters
elements
IEnumerable<BsonElement >A list of elements to add to the document.
BsonDocument(params BsonElement[])
Initializes a new instance of the BsonDocument class and adds one or more elements.
[Obsolete("Use BsonDocument(IEnumerable<BsonElement> elements) instead.")]
public BsonDocument(params BsonElement[] elements)
Parameters
elements
BsonElement []One or more elements to add to the document.
BsonDocument(string, BsonValue)
Initializes a new instance of the BsonDocument class and creates and adds a new element.