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