Method Inc
| MongoDB CSharp Driver API Reference (original) (raw)
Namespace
Assembly
MongoDB.Driver.dll
Inc<TDocument, TField>(UpdateDefinition, FieldDefinition<TDocument, TField>, TField)
Combines an existing update with an increment operator.
public static UpdateDefinition<TDocument> Inc<TDocument, TField>(this UpdateDefinition<TDocument> update, FieldDefinition<TDocument, TField> field, TField value)
Parameters
update
UpdateDefinition
The update.
field
FieldDefinition<TDocument, TField>
The field.
value
TField
The value.
Returns
A combined update.
Type Parameters
TDocument
The type of the document.
TField
The type of the field.
Inc<TDocument, TField>(UpdateDefinition, Expression<Func<TDocument, TField>>, TField)
Combines an existing update with an increment operator.
public static UpdateDefinition<TDocument> Inc<TDocument, TField>(this UpdateDefinition<TDocument> update, Expression<Func<TDocument, TField>> field, TField value)
Parameters
update
UpdateDefinition
The update.
field
Expression<Func<TDocument, TField>>
The field.
value
TField
The value.
Returns
A combined update.
Type Parameters
TDocument
The type of the document.
TField
The type of the field.