Class UpdateDefinitionExtensions
Extension methods for UpdateDefinition.
public static class UpdateDefinitionExtensions
- Inheritance
-
UpdateDefinitionExtensions
- Inherited Members
Methods
AddToSetEach<TDocument, TItem>(UpdateDefinition<TDocument>, FieldDefinition<TDocument>, IEnumerable<TItem>)
Combines an existing update with an add to set operator.
public static UpdateDefinition<TDocument> AddToSetEach<TDocument, TItem>(this UpdateDefinition<TDocument> update, FieldDefinition<TDocument> field, IEnumerable<TItem> values)
Parameters
update
UpdateDefinition<TDocument>The update.
field
FieldDefinition<TDocument>The field.
values
IEnumerable<TItem>The values.
Returns
- UpdateDefinition<TDocument>
A combined update.
Type Parameters
TDocument
The type of the document.
TItem
The type of the item.
AddToSetEach<TDocument, TItem>(UpdateDefinition<TDocument>, Expression<Func<TDocument, IEnumerable<TItem>>>, IEnumerable<TItem>)
Combines an existing update with an add to set operator.
public static UpdateDefinition<TDocument> AddToSetEach<TDocument, TItem>(this UpdateDefinition<TDocument> update, Expression<Func<TDocument, IEnumerable<TItem>>> field, IEnumerable<TItem> values)
Parameters
update
UpdateDefinition<TDocument>The update.
field
Expression<Func<TDocument, IEnumerable<TItem>>>The field.
values
IEnumerable<TItem>The values.
Returns
- UpdateDefinition<TDocument>
A combined update.
Type Parameters
TDocument
The type of the document.
TItem
The type of the item.
AddToSet<TDocument, TItem>(UpdateDefinition<TDocument>, FieldDefinition<TDocument>, TItem)
Combines an existing update with an add to set operator.
public static UpdateDefinition<TDocument> AddToSet<TDocument, TItem>(this UpdateDefinition<TDocument> update, FieldDefinition<TDocument> field, TItem value)
Parameters
update
UpdateDefinition<TDocument>The update.
field
FieldDefinition<TDocument>The field.
value
TItemThe value.
Returns
- UpdateDefinition<TDocument>
A combined update.
Type Parameters
TDocument
The type of the document.
TItem
The type of the item.
AddToSet<TDocument, TItem>(UpdateDefinition<TDocument>, Expression<Func<TDocument, IEnumerable<TItem>>>, TItem)
Combines an existing update with an add to set operator.
public static UpdateDefinition<TDocument> AddToSet<TDocument, TItem>(this UpdateDefinition<TDocument> update, Expression<Func<TDocument, IEnumerable<TItem>>> field, TItem value)
Parameters
update
UpdateDefinition<TDocument>The update.
field
Expression<Func<TDocument, IEnumerable<TItem>>>The field.
value
TItemThe value.
Returns
- UpdateDefinition<TDocument>
A combined update.
Type Parameters
TDocument
The type of the document.
TItem
The type of the item.
BitwiseAnd<TDocument, TField>(UpdateDefinition<TDocument>, FieldDefinition<TDocument, TField>, TField)
Combines an existing update with a bitwise and operator.
public static UpdateDefinition<TDocument> BitwiseAnd<TDocument, TField>(this UpdateDefinition<TDocument> update, FieldDefinition<TDocument, TField> field, TField value)
Parameters
update
UpdateDefinition<TDocument>The update.
field
FieldDefinition<TDocument, TField>The field.
value
TFieldThe value.
Returns
- UpdateDefinition<TDocument>
A combined update.
Type Parameters
TDocument
The type of the document.
TField
The type of the field.
BitwiseAnd<TDocument, TField>(UpdateDefinition<TDocument>, Expression<Func<TDocument, TField>>, TField)
Combines an existing update with a bitwise and operator.
public static UpdateDefinition<TDocument> BitwiseAnd<TDocument, TField>(this UpdateDefinition<TDocument> update, Expression<Func<TDocument, TField>> field, TField value)
Parameters
update
UpdateDefinition<TDocument>The update.
field
Expression<Func<TDocument, TField>>The field.
value
TFieldThe value.
Returns
- UpdateDefinition<TDocument>
A combined update.
Type Parameters
TDocument
The type of the document.
TField
The type of the field.
BitwiseOr<TDocument, TField>(UpdateDefinition<TDocument>, FieldDefinition<TDocument, TField>, TField)
Combines an existing update with a bitwise or operator.
public static UpdateDefinition<TDocument> BitwiseOr<TDocument, TField>(this UpdateDefinition<TDocument> update, FieldDefinition<TDocument, TField> field, TField value)
Parameters
update
UpdateDefinition<TDocument>The update.
field
FieldDefinition<TDocument, TField>The field.
value
TFieldThe value.
Returns
- UpdateDefinition<TDocument>
A combined update.
Type Parameters
TDocument
The type of the document.
TField
The type of the field.
BitwiseOr<TDocument, TField>(UpdateDefinition<TDocument>, Expression<Func<TDocument, TField>>, TField)
Combines an existing update with a bitwise or operator.
public static UpdateDefinition<TDocument> BitwiseOr<TDocument, TField>(this UpdateDefinition<TDocument> update, Expression<Func<TDocument, TField>> field, TField value)
Parameters
update
UpdateDefinition<TDocument>The update.
field
Expression<Func<TDocument, TField>>The field.
value
TFieldThe value.
Returns
- UpdateDefinition<TDocument>
A combined update.
Type Parameters
TDocument
The type of the document.
TField
The type of the field.
BitwiseXor<TDocument, TField>(UpdateDefinition<TDocument>, FieldDefinition<TDocument, TField>, TField)
Combines an existing update with a bitwise xor operator.
public static UpdateDefinition<TDocument> BitwiseXor<TDocument, TField>(this UpdateDefinition<TDocument> update, FieldDefinition<TDocument, TField> field, TField value)
Parameters
update
UpdateDefinition<TDocument>The update.
field
FieldDefinition<TDocument, TField>The field.
value
TFieldThe value.
Returns
- UpdateDefinition<TDocument>
A combined update.
Type Parameters
TDocument
The type of the document.
TField
The type of the field.
BitwiseXor<TDocument, TField>(UpdateDefinition<TDocument>, Expression<Func<TDocument, TField>>, TField)
Combines an existing update with a bitwise xor operator.
public static UpdateDefinition<TDocument> BitwiseXor<TDocument, TField>(this UpdateDefinition<TDocument> update, Expression<Func<TDocument, TField>> field, TField value)
Parameters
update
UpdateDefinition<TDocument>The update.
field
Expression<Func<TDocument, TField>>The field.
value
TFieldThe value.
Returns
- UpdateDefinition<TDocument>
A combined update.
Type Parameters
TDocument
The type of the document.
TField
The type of the field.
CurrentDate<TDocument>(UpdateDefinition<TDocument>, FieldDefinition<TDocument>, UpdateDefinitionCurrentDateType?)
Combines an existing update with a current date operator.
public static UpdateDefinition<TDocument> CurrentDate<TDocument>(this UpdateDefinition<TDocument> update, FieldDefinition<TDocument> field, UpdateDefinitionCurrentDateType? type = null)
Parameters
update
UpdateDefinition<TDocument>The update.
field
FieldDefinition<TDocument>The field.
type
UpdateDefinitionCurrentDateType?The type.
Returns
- UpdateDefinition<TDocument>
A combined update.
Type Parameters
TDocument
The type of the document.
CurrentDate<TDocument>(UpdateDefinition<TDocument>, Expression<Func<TDocument, object>>, UpdateDefinitionCurrentDateType?)
Combines an existing update with a current date operator.
public static UpdateDefinition<TDocument> CurrentDate<TDocument>(this UpdateDefinition<TDocument> update, Expression<Func<TDocument, object>> field, UpdateDefinitionCurrentDateType? type = null)
Parameters
update
UpdateDefinition<TDocument>The update.
field
Expression<Func<TDocument, object>>The field.
type
UpdateDefinitionCurrentDateType?The type.
Returns
- UpdateDefinition<TDocument>
A combined update.
Type Parameters
TDocument
The type of the document.
Inc<TDocument, TField>(UpdateDefinition<TDocument>, 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<TDocument>The update.
field
FieldDefinition<TDocument, TField>The field.
value
TFieldThe value.
Returns
- UpdateDefinition<TDocument>
A combined update.
Type Parameters
TDocument
The type of the document.
TField
The type of the field.
Inc<TDocument, TField>(UpdateDefinition<TDocument>, 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<TDocument>The update.
field
Expression<Func<TDocument, TField>>The field.
value
TFieldThe value.
Returns
- UpdateDefinition<TDocument>
A combined update.
Type Parameters
TDocument
The type of the document.
TField
The type of the field.
Max<TDocument, TField>(UpdateDefinition<TDocument>, FieldDefinition<TDocument, TField>, TField)
Combines an existing update with a max operator.
public static UpdateDefinition<TDocument> Max<TDocument, TField>(this UpdateDefinition<TDocument> update, FieldDefinition<TDocument, TField> field, TField value)
Parameters
update
UpdateDefinition<TDocument>The update.
field
FieldDefinition<TDocument, TField>The field.
value
TFieldThe value.
Returns
- UpdateDefinition<TDocument>
A combined update.
Type Parameters
TDocument
The type of the document.
TField
The type of the field.
Max<TDocument, TField>(UpdateDefinition<TDocument>, Expression<Func<TDocument, TField>>, TField)
Combines an existing update with a max operator.
public static UpdateDefinition<TDocument> Max<TDocument, TField>(this UpdateDefinition<TDocument> update, Expression<Func<TDocument, TField>> field, TField value)
Parameters
update
UpdateDefinition<TDocument>The update.
field
Expression<Func<TDocument, TField>>The field.
value
TFieldThe value.
Returns
- UpdateDefinition<TDocument>
A combined update.
Type Parameters
TDocument
The type of the document.
TField
The type of the field.
Min<TDocument, TField>(UpdateDefinition<TDocument>, FieldDefinition<TDocument, TField>, TField)
Combines an existing update with a min operator.
public static UpdateDefinition<TDocument> Min<TDocument, TField>(this UpdateDefinition<TDocument> update, FieldDefinition<TDocument, TField> field, TField value)
Parameters
update
UpdateDefinition<TDocument>The update.
field
FieldDefinition<TDocument, TField>The field.
value
TFieldThe value.
Returns
- UpdateDefinition<TDocument>
A combined update.
Type Parameters
TDocument
The type of the document.
TField
The type of the field.
Min<TDocument, TField>(UpdateDefinition<TDocument>, Expression<Func<TDocument, TField>>, TField)
Combines an existing update with a min operator.
public static UpdateDefinition<TDocument> Min<TDocument, TField>(this UpdateDefinition<TDocument> update, Expression<Func<TDocument, TField>> field, TField value)
Parameters
update
UpdateDefinition<TDocument>The update.
field
Expression<Func<TDocument, TField>>The field.
value
TFieldThe value.
Returns
- UpdateDefinition<TDocument>
A combined update.
Type Parameters
TDocument
The type of the document.
TField
The type of the field.
Mul<TDocument, TField>(UpdateDefinition<TDocument>, FieldDefinition<TDocument, TField>, TField)
Combines an existing update with a multiply operator.
public static UpdateDefinition<TDocument> Mul<TDocument, TField>(this UpdateDefinition<TDocument> update, FieldDefinition<TDocument, TField> field, TField value)
Parameters
update
UpdateDefinition<TDocument>The update.
field
FieldDefinition<TDocument, TField>The field.
value
TFieldThe value.
Returns
- UpdateDefinition<TDocument>
A combined update.
Type Parameters
TDocument
The type of the document.
TField
The type of the field.
Mul<TDocument, TField>(UpdateDefinition<TDocument>, Expression<Func<TDocument, TField>>, TField)
Combines an existing update with a multiply operator.
public static UpdateDefinition<TDocument> Mul<TDocument, TField>(this UpdateDefinition<TDocument> update, Expression<Func<TDocument, TField>> field, TField value)
Parameters
update
UpdateDefinition<TDocument>The update.
field
Expression<Func<TDocument, TField>>The field.
value
TFieldThe value.
Returns
- UpdateDefinition<TDocument>
A combined update.
Type Parameters
TDocument
The type of the document.
TField
The type of the field.
PopFirst<TDocument>(UpdateDefinition<TDocument>, FieldDefinition<TDocument>)
Combines an existing update with a pop operator.
public static UpdateDefinition<TDocument> PopFirst<TDocument>(this UpdateDefinition<TDocument> update, FieldDefinition<TDocument> field)
Parameters
update
UpdateDefinition<TDocument>The update.
field
FieldDefinition<TDocument>The field.
Returns
- UpdateDefinition<TDocument>
A combined update.
Type Parameters
TDocument
The type of the document.
PopFirst<TDocument>(UpdateDefinition<TDocument>, Expression<Func<TDocument, object>>)
Combines an existing update with a pop operator.
public static UpdateDefinition<TDocument> PopFirst<TDocument>(this UpdateDefinition<TDocument> update, Expression<Func<TDocument, object>> field)
Parameters
update
UpdateDefinition<TDocument>The update.
field
Expression<Func<TDocument, object>>The field.
Returns
- UpdateDefinition<TDocument>
A combined update.
Type Parameters
TDocument
The type of the document.
PopLast<TDocument>(UpdateDefinition<TDocument>, FieldDefinition<TDocument>)
Combines an existing update with a pop operator.
public static UpdateDefinition<TDocument> PopLast<TDocument>(this UpdateDefinition<TDocument> update, FieldDefinition<TDocument> field)
Parameters
update
UpdateDefinition<TDocument>The update.
field
FieldDefinition<TDocument>The field.
Returns
- UpdateDefinition<TDocument>
A combined update.
Type Parameters
TDocument
The type of the document.
PopLast<TDocument>(UpdateDefinition<TDocument>, Expression<Func<TDocument, object>>)
Combines an existing update with a pop operator.
public static UpdateDefinition<TDocument> PopLast<TDocument>(this UpdateDefinition<TDocument> update, Expression<Func<TDocument, object>> field)
Parameters
update
UpdateDefinition<TDocument>The update.
field
Expression<Func<TDocument, object>>The field.
Returns
- UpdateDefinition<TDocument>
A combined update.
Type Parameters
TDocument
The type of the document.
PullAll<TDocument, TItem>(UpdateDefinition<TDocument>, FieldDefinition<TDocument>, IEnumerable<TItem>)
Combines an existing update with a pull operator.
public static UpdateDefinition<TDocument> PullAll<TDocument, TItem>(this UpdateDefinition<TDocument> update, FieldDefinition<TDocument> field, IEnumerable<TItem> values)
Parameters
update
UpdateDefinition<TDocument>The update.
field
FieldDefinition<TDocument>The field.
values
IEnumerable<TItem>The values.
Returns
- UpdateDefinition<TDocument>
A combined update.
Type Parameters
TDocument
The type of the document.
TItem
The type of the item.
PullAll<TDocument, TItem>(UpdateDefinition<TDocument>, Expression<Func<TDocument, IEnumerable<TItem>>>, IEnumerable<TItem>)
Combines an existing update with a pull operator.
public static UpdateDefinition<TDocument> PullAll<TDocument, TItem>(this UpdateDefinition<TDocument> update, Expression<Func<TDocument, IEnumerable<TItem>>> field, IEnumerable<TItem> values)
Parameters
update
UpdateDefinition<TDocument>The update.
field
Expression<Func<TDocument, IEnumerable<TItem>>>The field.
values
IEnumerable<TItem>The values.
Returns
- UpdateDefinition<TDocument>
A combined update.
Type Parameters
TDocument
The type of the document.
TItem
The type of the item.
PullFilter<TDocument, TItem>(UpdateDefinition<TDocument>, FieldDefinition<TDocument>, FilterDefinition<TItem>)
Combines an existing update with a pull operator.
public static UpdateDefinition<TDocument> PullFilter<TDocument, TItem>(this UpdateDefinition<TDocument> update, FieldDefinition<TDocument> field, FilterDefinition<TItem> filter)
Parameters
update
UpdateDefinition<TDocument>The update.
field
FieldDefinition<TDocument>The field.
filter
FilterDefinition<TItem>The filter.
Returns
- UpdateDefinition<TDocument>
A combined update.
Type Parameters
TDocument
The type of the document.
TItem
The type of the item.
PullFilter<TDocument, TItem>(UpdateDefinition<TDocument>, Expression<Func<TDocument, IEnumerable<TItem>>>, FilterDefinition<TItem>)
Combines an existing update with a pull operator.
public static UpdateDefinition<TDocument> PullFilter<TDocument, TItem>(this UpdateDefinition<TDocument> update, Expression<Func<TDocument, IEnumerable<TItem>>> field, FilterDefinition<TItem> filter)
Parameters
update
UpdateDefinition<TDocument>The update.
field
Expression<Func<TDocument, IEnumerable<TItem>>>The field.
filter
FilterDefinition<TItem>The filter.
Returns
- UpdateDefinition<TDocument>
A combined update.
Type Parameters
TDocument
The type of the document.
TItem
The type of the item.
PullFilter<TDocument, TItem>(UpdateDefinition<TDocument>, Expression<Func<TDocument, IEnumerable<TItem>>>, Expression<Func<TItem, bool>>)
Combines an existing update with a pull operator.
public static UpdateDefinition<TDocument> PullFilter<TDocument, TItem>(this UpdateDefinition<TDocument> update, Expression<Func<TDocument, IEnumerable<TItem>>> field, Expression<Func<TItem, bool>> filter)
Parameters
update
UpdateDefinition<TDocument>The update.
field
Expression<Func<TDocument, IEnumerable<TItem>>>The field.
filter
Expression<Func<TItem, bool>>The filter.
Returns
- UpdateDefinition<TDocument>
A combined update.
Type Parameters
TDocument
The type of the document.
TItem
The type of the item.
Pull<TDocument, TItem>(UpdateDefinition<TDocument>, FieldDefinition<TDocument>, TItem)
Combines an existing update with a pull operator.
public static UpdateDefinition<TDocument> Pull<TDocument, TItem>(this UpdateDefinition<TDocument> update, FieldDefinition<TDocument> field, TItem value)
Parameters
update
UpdateDefinition<TDocument>The update.
field
FieldDefinition<TDocument>The field.
value
TItemThe value.
Returns
- UpdateDefinition<TDocument>
A combined update.
Type Parameters
TDocument
The type of the document.
TItem
The type of the item.
Pull<TDocument, TItem>(UpdateDefinition<TDocument>, Expression<Func<TDocument, IEnumerable<TItem>>>, TItem)
Combines an existing update with a pull operator.
public static UpdateDefinition<TDocument> Pull<TDocument, TItem>(this UpdateDefinition<TDocument> update, Expression<Func<TDocument, IEnumerable<TItem>>> field, TItem value)
Parameters
update
UpdateDefinition<TDocument>The update.
field
Expression<Func<TDocument, IEnumerable<TItem>>>The field.
value
TItemThe value.
Returns
- UpdateDefinition<TDocument>
A combined update.
Type Parameters
TDocument
The type of the document.
TItem
The type of the item.
PushEach<TDocument, TItem>(UpdateDefinition<TDocument>, FieldDefinition<TDocument>, IEnumerable<TItem>, int?, int?, SortDefinition<TItem>)
Combines an existing update with a push operator.
public static UpdateDefinition<TDocument> PushEach<TDocument, TItem>(this UpdateDefinition<TDocument> update, FieldDefinition<TDocument> field, IEnumerable<TItem> values, int? slice = null, int? position = null, SortDefinition<TItem> sort = null)
Parameters
update
UpdateDefinition<TDocument>The update.
field
FieldDefinition<TDocument>The field.
values
IEnumerable<TItem>The values.
slice
int?The slice.
position
int?The position.
sort
SortDefinition<TItem>The sort.
Returns
- UpdateDefinition<TDocument>
A combined update.
Type Parameters
TDocument
The type of the document.
TItem
The type of the item.
PushEach<TDocument, TItem>(UpdateDefinition<TDocument>, Expression<Func<TDocument, IEnumerable<TItem>>>, IEnumerable<TItem>, int?, int?, SortDefinition<TItem>)
Combines an existing update with a push operator.
public static UpdateDefinition<TDocument> PushEach<TDocument, TItem>(this UpdateDefinition<TDocument> update, Expression<Func<TDocument, IEnumerable<TItem>>> field, IEnumerable<TItem> values, int? slice = null, int? position = null, SortDefinition<TItem> sort = null)
Parameters
update
UpdateDefinition<TDocument>The update.
field
Expression<Func<TDocument, IEnumerable<TItem>>>The field.
values
IEnumerable<TItem>The values.
slice
int?The slice.
position
int?The position.
sort
SortDefinition<TItem>The sort.
Returns
- UpdateDefinition<TDocument>
A combined update.
Type Parameters
TDocument
The type of the document.
TItem
The type of the item.
Push<TDocument, TItem>(UpdateDefinition<TDocument>, FieldDefinition<TDocument>, TItem)
Combines an existing update with a push operator.
public static UpdateDefinition<TDocument> Push<TDocument, TItem>(this UpdateDefinition<TDocument> update, FieldDefinition<TDocument> field, TItem value)
Parameters
update
UpdateDefinition<TDocument>The update.
field
FieldDefinition<TDocument>The field.
value
TItemThe value.
Returns
- UpdateDefinition<TDocument>
A combined update.
Type Parameters
TDocument
The type of the document.
TItem
The type of the item.
Push<TDocument, TItem>(UpdateDefinition<TDocument>, Expression<Func<TDocument, IEnumerable<TItem>>>, TItem)
Combines an existing update with a push operator.
public static UpdateDefinition<TDocument> Push<TDocument, TItem>(this UpdateDefinition<TDocument> update, Expression<Func<TDocument, IEnumerable<TItem>>> field, TItem value)
Parameters
update
UpdateDefinition<TDocument>The update.
field
Expression<Func<TDocument, IEnumerable<TItem>>>The field.
value
TItemThe value.
Returns
- UpdateDefinition<TDocument>
A combined update.
Type Parameters
TDocument
The type of the document.
TItem
The type of the item.
Rename<TDocument>(UpdateDefinition<TDocument>, FieldDefinition<TDocument>, string)
Combines an existing update with a field renaming operator.
public static UpdateDefinition<TDocument> Rename<TDocument>(this UpdateDefinition<TDocument> update, FieldDefinition<TDocument> field, string newName)
Parameters
update
UpdateDefinition<TDocument>The update.
field
FieldDefinition<TDocument>The field.
newName
stringThe new name.
Returns
- UpdateDefinition<TDocument>
A combined update.
Type Parameters
TDocument
The type of the document.
Rename<TDocument>(UpdateDefinition<TDocument>, Expression<Func<TDocument, object>>, string)
Combines an existing update with a field renaming operator.
public static UpdateDefinition<TDocument> Rename<TDocument>(this UpdateDefinition<TDocument> update, Expression<Func<TDocument, object>> field, string newName)
Parameters
update
UpdateDefinition<TDocument>The update.
field
Expression<Func<TDocument, object>>The field.
newName
stringThe new name.
Returns
- UpdateDefinition<TDocument>
A combined update.
Type Parameters
TDocument
The type of the document.
SetOnInsert<TDocument, TField>(UpdateDefinition<TDocument>, FieldDefinition<TDocument, TField>, TField)
Combines an existing update with a set on insert operator.
public static UpdateDefinition<TDocument> SetOnInsert<TDocument, TField>(this UpdateDefinition<TDocument> update, FieldDefinition<TDocument, TField> field, TField value)
Parameters
update
UpdateDefinition<TDocument>The update.
field
FieldDefinition<TDocument, TField>The field.
value
TFieldThe value.
Returns
- UpdateDefinition<TDocument>
A combined update.
Type Parameters
TDocument
The type of the document.
TField
The type of the field.
SetOnInsert<TDocument, TField>(UpdateDefinition<TDocument>, Expression<Func<TDocument, TField>>, TField)
Combines an existing update with a set on insert operator.
public static UpdateDefinition<TDocument> SetOnInsert<TDocument, TField>(this UpdateDefinition<TDocument> update, Expression<Func<TDocument, TField>> field, TField value)
Parameters
update
UpdateDefinition<TDocument>The update.
field
Expression<Func<TDocument, TField>>The field.
value
TFieldThe value.
Returns
- UpdateDefinition<TDocument>
A combined update.
Type Parameters
TDocument
The type of the document.
TField
The type of the field.
Set<TDocument, TField>(UpdateDefinition<TDocument>, FieldDefinition<TDocument, TField>, TField)
Combines an existing update with a set operator.
public static UpdateDefinition<TDocument> Set<TDocument, TField>(this UpdateDefinition<TDocument> update, FieldDefinition<TDocument, TField> field, TField value)
Parameters
update
UpdateDefinition<TDocument>The update.
field
FieldDefinition<TDocument, TField>The field.
value
TFieldThe value.
Returns
- UpdateDefinition<TDocument>
A combined update.
Type Parameters
TDocument
The type of the document.
TField
The type of the field.
Set<TDocument, TField>(UpdateDefinition<TDocument>, Expression<Func<TDocument, TField>>, TField)
Combines an existing update with a set operator.
public static UpdateDefinition<TDocument> Set<TDocument, TField>(this UpdateDefinition<TDocument> update, Expression<Func<TDocument, TField>> field, TField value)
Parameters
update
UpdateDefinition<TDocument>The update.
field
Expression<Func<TDocument, TField>>The field.
value
TFieldThe value.
Returns
- UpdateDefinition<TDocument>
A combined update.
Type Parameters
TDocument
The type of the document.
TField
The type of the field.
Unset<TDocument>(UpdateDefinition<TDocument>, FieldDefinition<TDocument>)
Combines an existing update with an unset operator.
public static UpdateDefinition<TDocument> Unset<TDocument>(this UpdateDefinition<TDocument> update, FieldDefinition<TDocument> field)
Parameters
update
UpdateDefinition<TDocument>The update.
field
FieldDefinition<TDocument>The field.
Returns
- UpdateDefinition<TDocument>
A combined update.
Type Parameters
TDocument
The type of the document.
Unset<TDocument>(UpdateDefinition<TDocument>, Expression<Func<TDocument, object>>)
Combines an existing update with an unset operator.
public static UpdateDefinition<TDocument> Unset<TDocument>(this UpdateDefinition<TDocument> update, Expression<Func<TDocument, object>> field)
Parameters
update
UpdateDefinition<TDocument>The update.
field
Expression<Func<TDocument, object>>The field.
Returns
- UpdateDefinition<TDocument>
A combined update.
Type Parameters
TDocument
The type of the document.