Table of Contents

Method AddToSetEach

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

AddToSetEach(string, BsonArray)

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 AddToSetEach(string name, BsonArray values)

Parameters

name string

The name of the array element.

values BsonArray

The values to add to the set.

Returns

UpdateBuilder

The builder (so method calls can be chained).

AddToSetEach(string, IEnumerable<BsonValue>)

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 AddToSetEach(string name, IEnumerable<BsonValue> values)

Parameters

name string

The name of the array element.

values IEnumerable<BsonValue>

The values to add to the set.

Returns

UpdateBuilder

The builder (so method calls can be chained).

AddToSetEach(string, params BsonValue[])

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 AddToSetEach(string name, params BsonValue[] values)

Parameters

name string

The name of the array element.

values BsonValue[]

The values to add to the set.

Returns

UpdateBuilder

The builder (so method calls can be chained).