Class UpdateDocument
Represents a BSON document that can be used where an IMongoUpdate is expected.
[BsonSerializer(typeof(UpdateDocument.Serializer))]
public class UpdateDocument : BsonDocument, IComparable<BsonValue>, IConvertible, IEquatable<BsonValue>, IComparable<BsonDocument>, IConvertibleToBsonDocument, IEnumerable<BsonElement>, IEnumerable, IEquatable<BsonDocument>, IMongoUpdate
- Inheritance
-
UpdateDocument
- Implements
- Inherited Members
- Extension Methods
Constructors
UpdateDocument()
Initializes a new instance of the UpdateDocument class.
public UpdateDocument()
UpdateDocument(BsonElement)
Initializes a new instance of the UpdateDocument class and adds one element.
public UpdateDocument(BsonElement element)
Parameters
elementBsonElementAn element to add to the document.
UpdateDocument(params BsonElement[])
Initializes a new instance of the UpdateDocument class and adds one or more elements.
[Obsolete("Use UpdateDocument<IEnumerable<BsonElement> elements) instead.")]
public UpdateDocument(params BsonElement[] elements)
Parameters
elementsBsonElement[]One or more elements to add to the document.
UpdateDocument(bool)
Initializes a new instance of the UpdateDocument class specifying whether duplicate element names are allowed (allowing duplicate element names is not recommended).
public UpdateDocument(bool allowDuplicateNames)
Parameters
allowDuplicateNamesboolWhether duplicate element names are allowed.
UpdateDocument(Dictionary<string, object>)
Initializes a new instance of the UpdateDocument class and adds new elements from a dictionary of key/value pairs.
public UpdateDocument(Dictionary<string, object> dictionary)
Parameters
dictionaryDictionary<string, object>A dictionary to initialize the document from.
UpdateDocument(Dictionary<string, object>, IEnumerable<string>)
Initializes a new instance of the UpdateDocument class and adds new elements from a dictionary of key/value pairs.
[Obsolete("Use UpdateDocument<IEnumerable<BsonElement> elements) instead.")]
public UpdateDocument(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.
UpdateDocument(IDictionary<string, object>, IEnumerable<string>)
Initializes a new instance of the UpdateDocument class and adds new elements from a dictionary of key/value pairs.
[Obsolete("Use UpdateDocument<IEnumerable<BsonElement> elements) instead.")]
public UpdateDocument(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.
UpdateDocument(IEnumerable<BsonElement>)
Initializes a new instance of the UpdateDocument class and adds new elements from a list of elements.
public UpdateDocument(IEnumerable<BsonElement> elements)
Parameters
elementsIEnumerable<BsonElement>A list of elements to add to the document.
UpdateDocument(IEnumerable<KeyValuePair<string, object>>)
Initializes a new instance of the UpdateDocument class and adds new elements from a dictionary of key/value pairs.
public UpdateDocument(IEnumerable<KeyValuePair<string, object>> dictionary)
Parameters
dictionaryIEnumerable<KeyValuePair<string, object>>A dictionary to initialize the document from.
UpdateDocument(IDictionary)
Initializes a new instance of the UpdateDocument class and adds new elements from a dictionary of key/value pairs.
public UpdateDocument(IDictionary dictionary)
Parameters
dictionaryIDictionaryA dictionary to initialize the document from.
UpdateDocument(IDictionary, IEnumerable)
Initializes a new instance of the UpdateDocument class and adds new elements from a dictionary of key/value pairs.
[Obsolete("Use UpdateDocument<IEnumerable<BsonElement> elements) instead.")]
public UpdateDocument(IDictionary dictionary, IEnumerable keys)
Parameters
dictionaryIDictionaryA dictionary to initialize the document from.
keysIEnumerableA list of keys to select values from the dictionary.
UpdateDocument(string, BsonValue)
Initializes a new instance of the UpdateDocument class and creates and adds a new element.
public UpdateDocument(string name, BsonValue value)