Table of Contents

Method AddToSet

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

AddToSet(string, BsonValue)

Adds a value to a named array element if the value is not already in the array (see $addToSet).

public UpdateBuilder AddToSet(string name, BsonValue value)

Parameters

name string

The name of the array element.

value BsonValue

The value to add to the set.

Returns

UpdateBuilder

The builder (so method calls can be chained).