Table of Contents

Method Push

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

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 TItem

The 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 TItem

The value.

Returns

UpdateDefinition<TDocument>

A combined update.

Type Parameters

TDocument

The type of the document.

TItem

The type of the item.