Table of Contents

Method PushEach

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

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.