public function notWhere($clause, $type = '$and')
    {
        if ($clause instanceof Closure) {
            $query = new static();
            $clause($query);
            $clause = $query->getWhere();

            if (empty($clause)) {
                return $this;
            }
        }

        if (! is_array($clause)) {
            throw new \InvalidArgumentException('$not statements should be Closures or arrays.');
        }

        return $this->formatWhere($type, '$not', [$clause]);
    }