Constructor CollectionOptionsDocument
CollectionOptionsDocument()
Initializes a new instance of the CollectionOptionsDocument class.
public CollectionOptionsDocument()
CollectionOptionsDocument(bool)
Initializes a new instance of the CollectionOptionsDocument class specifying whether duplicate element names are allowed (allowing duplicate element names is not recommended).
public CollectionOptionsDocument(bool allowDuplicateNames)
Parameters
allowDuplicateNamesboolWhether duplicate element names are allowed.
CollectionOptionsDocument(BsonElement)
Initializes a new instance of the CollectionOptionsDocument class and adds one element.
public CollectionOptionsDocument(BsonElement element)
Parameters
elementBsonElementAn element to add to the document.
CollectionOptionsDocument(Dictionary<string, object>)
Initializes a new instance of the CollectionOptionsDocument class and adds new elements from a dictionary of key/value pairs.
public CollectionOptionsDocument(Dictionary<string, object> dictionary)
Parameters
dictionaryDictionary<string, object>A dictionary to initialize the document from.
CollectionOptionsDocument(Dictionary<string, object>, IEnumerable<string>)
Initializes a new instance of the CollectionOptionsDocument class and adds new elements from a dictionary of key/value pairs.
[Obsolete("Use CollectionOptionsDocument<IEnumerable<BsonElement> elements) instead.")]
public CollectionOptionsDocument(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.
CollectionOptionsDocument(IEnumerable<KeyValuePair<string, object>>)
Initializes a new instance of the CollectionOptionsDocument class and adds new elements from a dictionary of key/value pairs.
public CollectionOptionsDocument(IEnumerable<KeyValuePair<string, object>> dictionary)
Parameters
dictionaryIEnumerable<KeyValuePair<string, object>>A dictionary to initialize the document from.
CollectionOptionsDocument(IDictionary<string, object>, IEnumerable<string>)
Initializes a new instance of the CollectionOptionsDocument class and adds new elements from a dictionary of key/value pairs.
[Obsolete("Use CollectionOptionsDocument<IEnumerable<BsonElement> elements) instead.")]
public CollectionOptionsDocument(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.
CollectionOptionsDocument(IDictionary)
Initializes a new instance of the CollectionOptionsDocument class and adds new elements from a dictionary of key/value pairs.
public CollectionOptionsDocument(IDictionary dictionary)
Parameters
dictionaryIDictionaryA dictionary to initialize the document from.
CollectionOptionsDocument(IDictionary, IEnumerable)
Initializes a new instance of the CollectionOptionsDocument class and adds new elements from a dictionary of key/value pairs.
[Obsolete("Use CollectionOptionsDocument<IEnumerable<BsonElement> elements) instead.")]
public CollectionOptionsDocument(IDictionary dictionary, IEnumerable keys)
Parameters
dictionaryIDictionaryA dictionary to initialize the document from.
keysIEnumerableA list of keys to select values from the dictionary.
CollectionOptionsDocument(IEnumerable<BsonElement>)
Initializes a new instance of the CollectionOptionsDocument class and adds new elements from a list of elements.
public CollectionOptionsDocument(IEnumerable<BsonElement> elements)
Parameters
elementsIEnumerable<BsonElement>A list of elements to add to the document.
CollectionOptionsDocument(params BsonElement[])
Initializes a new instance of the CollectionOptionsDocument class and adds one or more elements.
[Obsolete("Use CollectionOptionsDocument<IEnumerable<BsonElement> elements) instead.")]
public CollectionOptionsDocument(params BsonElement[] elements)
Parameters
elementsBsonElement[]One or more elements to add to the document.
CollectionOptionsDocument(string, BsonValue)
Initializes a new instance of the CollectionOptionsDocument class and creates and adds a new element.
public CollectionOptionsDocument(string name, BsonValue value)