driver-core/src/main/com/mongodb/client/model/Accumulators.java
public static <TExpression> BsonField addToSet(final String fieldName, final TExpression expression) {
        return accumulator("$addToSet", fieldName, expression);
    }
public static <TExpression> BsonField addToSet(final String fieldName, final TExpression expression) {
        return accumulator("$addToSet", fieldName, expression);
    }
Gets a field name for a $group operation representing all unique values that results from applying the given expression to each
document in a group of documents that share the same group by key.

@param fieldName the field name
@param expression the expression
@param <TExpression> the expression type
@return the field
@mongodb.driver.manual reference/operator/aggregation/addToSet/ $addToSet