Click or drag to resize

UpdateBuilder<TDocument> Class

A builder for creating update modifiers.
Inheritance Hierarchy
System.Object
  MongoDB.Driver.Builders.BuilderBase
    MongoDB.Driver.Builders.UpdateBuilder<TDocument>

Namespace:  MongoDB.Driver.Builders
Assembly:  MongoDB.Driver.Legacy (in MongoDB.Driver.Legacy.dll) Version: 2.14.0+2b37a1fe1cbdbe1a020b52b77f1197b6d77575e7
Syntax
[SerializableAttribute]
public class UpdateBuilder<TDocument> : BuilderBase, 
	IMongoUpdate

Type Parameters

TDocument
The type of the document.

The UpdateBuilder<TDocument> type exposes the following members.

Constructors
Methods
  NameDescription
Public methodAddToSet<TValue>
Adds a value to a named array element if the value is not already in the array (see $addToSet).
Public methodAddToSetEach<TValue>
Adds a list of values to a named array element adding each value only if it not already in the array (see $addToSet and $each).
Public methodBitwiseAnd(Expression<Func<TDocument, Int32>>, Int32)
Sets the named element to the bitwise and of its value with another value (see $bit with "and").
Public methodBitwiseAnd(Expression<Func<TDocument, Int64>>, Int64)
Sets the named element to the bitwise and of its value with another value (see $bit with "and").
Public methodBitwiseOr(Expression<Func<TDocument, Int32>>, Int32)
Sets the named element to the bitwise or of its value with another value (see $bit with "or").
Public methodBitwiseOr(Expression<Func<TDocument, Int64>>, Int64)
Sets the named element to the bitwise or of its value with another value (see $bit with "or").
Public methodBitwiseXor(Expression<Func<TDocument, Int32>>, Int32)
Sets the named element to the bitwise xor of its value with another value (see $bit with "xor").
Public methodBitwiseXor(Expression<Func<TDocument, Int64>>, Int64)
Sets the named element to the bitwise xor of its value with another value (see $bit with "xor").
Public methodCombine
Combines another UpdateBuilder into this one.
Public methodCurrentDate(Expression<Func<TDocument, BsonDateTime>>)
Sets the value of the named element to the current date (see $currentDate).
Public methodCurrentDate(Expression<Func<TDocument, BsonTimestamp>>)
Sets the value of the named element to the current date (see $currentDate).
Public methodCurrentDate(Expression<Func<TDocument, DateTime>>)
Sets the value of the named element to the current date (see $currentDate).
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodInc(Expression<Func<TDocument, Double>>, Double)
Increments the named element by a value (see $inc).
Public methodInc(Expression<Func<TDocument, Int32>>, Int32)
Increments the named element by a value (see $inc).
Public methodInc(Expression<Func<TDocument, Int64>>, Int64)
Increments the named element by a value (see $inc).
Public methodMax<TMember>
Updates the named element if and only if the provided value is greater than its current value (see $max).
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodMin<TMember>
Updates the named element if and only if the provided value is less than its current value (see $max).
Public methodMul(Expression<Func<TDocument, Double>>, Double)
Multiplies the named element by a value (see $mul).
Public methodMul(Expression<Func<TDocument, Int32>>, Int32)
Multiplies the named element by a value (see $mul).
Public methodMul(Expression<Func<TDocument, Int64>>, Int64)
Multiplies the named element by a value (see $mul).
Public methodPopFirst<TValue>
Removes the first value from the named array element (see $pop).
Public methodPopLast<TValue>
Removes the last value from the named array element (see $pop).
Public methodPull<TValue>(Expression<Func<TDocument, IEnumerable<TValue>>>, TValue)
Removes all values from the named array element that are equal to some value (see $pull).
Public methodPull<TValue>(Expression<Func<TDocument, IEnumerable<TValue>>>, Func<QueryBuilder<TValue>, IMongoQuery>)
Removes all values from the named array element that match some query (see $pull).
Public methodPullAll<TValue>
Removes all values from the named array element that are equal to any of a list of values (see $pullAll).
Public methodPush<TValue>
Adds a value to the end of the named array element (see $push).
Public methodPushAll<TValue>
Adds a list of values to the end of the named array element (see $pushAll).
Public methodPushEach<TValue>(Expression<Func<TDocument, IEnumerable<TValue>>>, IEnumerable<TValue>)
Adds a list of values to the end of the named array element (see $push and $each).
Public methodPushEach<TValue>(Expression<Func<TDocument, IEnumerable<TValue>>>, PushEachOptions, IEnumerable<TValue>)
Adds a list of values to the end of the named array element (see $push and $each).
Public methodPushEach<TValue>(Expression<Func<TDocument, IEnumerable<TValue>>>, Action<PushEachOptionsBuilder<TValue>>, IEnumerable<TValue>)
Adds a list of values to the end of the named array element (see $push and $each).
Public methodSet<TMember>
Sets the value of the named element to a new value (see $set).
Public methodSetOnInsert<TMember>
Sets the value of the named element to the specified value only when an insert occurs as part of an upsert operation (see $setOnInsert).
Public methodToBsonDocument
Converts this object to a BsonDocument.
(Overrides BuilderBase.ToBsonDocument().)
Public methodToString
Returns a string representation of the settings.
(Inherited from BuilderBase.)
Public methodUnset<TMember>
Removes the named element from the document (see $unset).
Top
Extension Methods
  NameDescription
Public Extension MethodToBson
Serializes an object to a BSON byte array.
(Defined by BsonExtensionMethods.)
Public Extension MethodToBsonDocument
Serializes an object to a BsonDocument.
(Defined by BsonExtensionMethods.)
Public Extension MethodToJson
Serializes an object to a JSON string.
(Defined by BsonExtensionMethods.)
Top
See Also