Table of Contents

Method AddToSetEach

Namespace
MongoDB.Driver.Builders
Assembly
MongoDB.Driver.Legacy.dll

AddToSetEach<TValue>(Expression<Func<TDocument, IEnumerable<TValue>>>, IEnumerable<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 UpdateBuilder<TDocument> AddToSetEach<TValue>(Expression<Func<TDocument, IEnumerable<TValue>>> memberExpression, IEnumerable<TValue> values)

Parameters

memberExpression Expression<Func<TDocument, IEnumerable<TValue>>>

The member expression.

values IEnumerable<TValue>

The values to add to the set.

Returns

UpdateBuilder<TDocument>

The builder (so method calls can be chained).

Type Parameters

TValue

The type of the enumerable member values.