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
allowDuplicateNamesboolWhether duplicate element names are allowed.
ScopeDocument(BsonElement)
Initializes a new instance of the ScopeDocument class and adds one element.
public ScopeDocument(BsonElement element)
Parameters
elementBsonElementAn 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
dictionaryDictionary<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
dictionaryDictionary<string, object>A dictionary to initialize the document from.
keysIEnumerable<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
dictionaryIEnumerable<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
dictionaryIDictionary<string, object>A dictionary to initialize the document from.
keysIEnumerable<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
dictionaryIDictionaryA 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
dictionaryIDictionaryA dictionary to initialize the document from.
keysIEnumerableA 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
elementsIEnumerable<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
elementsBsonElement[]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)