Class CollectionOptionsDocument
Represents a BSON document that can be used where an IMongoCollectionOptions is expected.
[BsonSerializer(typeof(CollectionOptionsDocument.Serializer))]
public class CollectionOptionsDocument : BsonDocument, IComparable<BsonValue>, IConvertible, IEquatable<BsonValue>, IComparable<BsonDocument>, IConvertibleToBsonDocument, IEnumerable<BsonElement>, IEnumerable, IEquatable<BsonDocument>, IMongoCollectionOptions
- Inheritance
-
Collection
Options Document
- Implements
- Inherited Members
- Extension Methods
Constructors
CollectionOptionsDocument()
Initializes a new instance of the CollectionOptionsDocument class.
CollectionOptionsDocument(BsonElement)
Initializes a new instance of the CollectionOptionsDocument class and adds one element.
Parameters
element
BsonElement An element 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
elements
BsonElement []One or more elements to add to the document.
CollectionOptionsDocument(bool)
Initializes a new instance of the CollectionOptionsDocument class specifying whether duplicate element names are allowed (allowing duplicate element names is not recommended).
Parameters
allowDuplicateNames
boolWhether duplicate element names are allowed.
CollectionOptionsDocument(Dictionary<string, object>)
Initializes a new instance of the CollectionOptionsDocument class and adds new elements from a dictionary of key/value pairs.
Parameters
dictionary
Dictionary<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
dictionary
Dictionary<string, object>A dictionary to initialize the document from.
keys
IEnumerable<string>A list of keys to select values from the dictionary.
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
dictionary
IDictionary<string, object>A dictionary to initialize the document from.
keys
IEnumerable<string>A 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.
Parameters
elements
IEnumerable<BsonElement >A list of elements to add to the document.
CollectionOptionsDocument(IEnumerable<KeyValuePair<string, object>>)
Initializes a new instance of the CollectionOptionsDocument class and adds new elements from a dictionary of key/value pairs.
Parameters
dictionary
IEnumerable<KeyValue <string, object>>Pair A dictionary to initialize the document from.
CollectionOptionsDocument(IDictionary)
Initializes a new instance of the CollectionOptionsDocument class and adds new elements from a dictionary of key/value pairs.
Parameters
dictionary
IDictionaryA 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
dictionary
IDictionaryA dictionary to initialize the document from.
keys
IEnumerableA list of keys to select values from the dictionary.
CollectionOptionsDocument(string, BsonValue)
Initializes a new instance of the CollectionOptionsDocument class and creates and adds a new element.