Constructor ScopeDocument
ScopeDocument()
Initializes a new instance of the ScopeDocument class.
public ScopeDocument()
ScopeDocument(bool)
Initializes a new instance of the ScopeDocument class specifying whether duplicate element names are allowed (allowing duplicate element names is not recommended).
public ScopeDocument(bool allowDuplicateNames)
Parameters
allowDuplicateNames
boolWhether duplicate element names are allowed.
ScopeDocument(BsonElement)
Initializes a new instance of the ScopeDocument class and adds one element.
public ScopeDocument(BsonElement element)
Parameters
element
BsonElementAn element to add to the document.
ScopeDocument(Dictionary<string, object>)
Initializes a new instance of the ScopeDocument class and adds new elements from a dictionary of key/value pairs.
public ScopeDocument(Dictionary<string, object> dictionary)
Parameters
dictionary
Dictionary<string, object>A dictionary to initialize the document from.
ScopeDocument(Dictionary<string, object>, IEnumerable<string>)
Initializes a new instance of the ScopeDocument class and adds new elements from a dictionary of key/value pairs.
[Obsolete("Use ScopeDocument<IEnumerable<BsonElement> elements) instead.")]
public ScopeDocument(Dictionary<string, object> dictionary, IEnumerable<string> keys)
Parameters
dictionary
Dictionary<string, object>A dictionary to initialize the document from.
keys
IEnumerable<string>A list of keys to select values from the dictionary.
ScopeDocument(IEnumerable<KeyValuePair<string, object>>)
Initializes a new instance of the ScopeDocument class and adds new elements from a dictionary of key/value pairs.
public ScopeDocument(IEnumerable<KeyValuePair<string, object>> dictionary)
Parameters
dictionary
IEnumerable<KeyValuePair<string, object>>A dictionary to initialize the document from.
ScopeDocument(IDictionary<string, object>, IEnumerable<string>)
Initializes a new instance of the ScopeDocument class and adds new elements from a dictionary of key/value pairs.
[Obsolete("Use ScopeDocument<IEnumerable<BsonElement> elements) instead.")]
public ScopeDocument(IDictionary<string, object> dictionary, IEnumerable<string> keys)
Parameters
dictionary
IDictionary<string, object>A dictionary to initialize the document from.
keys
IEnumerable<string>A list of keys to select values from the dictionary.
ScopeDocument(IDictionary)
Initializes a new instance of the ScopeDocument class and adds new elements from a dictionary of key/value pairs.
public ScopeDocument(IDictionary dictionary)
Parameters
dictionary
IDictionaryA dictionary to initialize the document from.
ScopeDocument(IDictionary, IEnumerable)
Initializes a new instance of the ScopeDocument class and adds new elements from a dictionary of key/value pairs.
[Obsolete("Use ScopeDocument<IEnumerable<BsonElement> elements) instead.")]
public ScopeDocument(IDictionary dictionary, IEnumerable keys)
Parameters
dictionary
IDictionaryA dictionary to initialize the document from.
keys
IEnumerableA list of keys to select values from the dictionary.
ScopeDocument(IEnumerable<BsonElement>)
Initializes a new instance of the ScopeDocument class and adds new elements from a list of elements.
public ScopeDocument(IEnumerable<BsonElement> elements)
Parameters
elements
IEnumerable<BsonElement>A list of elements to add to the document.
ScopeDocument(params BsonElement[])
Initializes a new instance of the ScopeDocument class and adds one or more elements.
[Obsolete("Use ScopeDocument<IEnumerable<BsonElement> elements) instead.")]
public ScopeDocument(params BsonElement[] elements)
Parameters
elements
BsonElement[]One or more elements to add to the document.
ScopeDocument(string, BsonValue)
Initializes a new instance of the ScopeDocument class and creates and adds a new element.
public ScopeDocument(string name, BsonValue value)