Doctrine\MongoDB\Query\Builder::addToSet PHP Method

addToSet() public method

If the field does not exist, it will be set to an array containing the unique value(s) in the argument. If the field is not an array, the query will yield an error. Multiple values may be specified by provided an Expr object and using {@link Expr::each()}.
See also: Expr::addToSet()
See also: http://docs.mongodb.org/manual/reference/operator/addToSet/
See also: http://docs.mongodb.org/manual/reference/operator/each/
public addToSet ( mixed | Expr $valueOrExpression )
$valueOrExpression mixed | Expr
    public function addToSet($valueOrExpression)
    {
        $this->expr->addToSet($valueOrExpression);
        return $this;
    }