LMongo\Query\Builder::whereNested PHP Method

whereNested() public method

Add a nested where statement to the query.
public whereNested ( Closure $callback, string $logic = '$and' ) : LMongo\Query\Builder
$callback Closure
$logic string
return LMongo\Query\Builder
    public function whereNested(Closure $callback, $logic = '$and')
    {
        $type = 'Nested';
        $query = $this->newQuery();
        call_user_func($callback, $query);
        if (count($query->wheres)) {
            $this->wheres[] = compact('type', 'query', 'logic');
        }
        return $this;
    }
Builder