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