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