public function where(string $field, $value)
    {
        $matches = [];
        // We check whether there is a specific operator in the field name,
        // and if so we validate it against a whitelist
        if (\preg_match('/(.+)\[([a-zA-Z]+)\]/', $field, $matches)) {
            $operator = \mb_strtolower($matches[2]);

            if (!\in_array($operator, self::$validOperators, true)) {
                throw new \InvalidArgumentException(\sprintf(
                    'Unknown operator "%s" given. Expected "%s" or no operator.',
                    $operator,
                    \implode(', ', self::$validOperators)
                ));
            }
        }

        if ($value instanceof \DateTimeInterface) {
            $value = $value->format(self::DATE_FORMAT);
        }
        if ($value instanceof Location) {
            $value = $value->queryStringFormatted();
        }
        if (\is_array($value)) {
            $value = \implode(',', $value);
        }

        $this->whereConditions[$field] = $value;

        return $this;
    }