private function hasResults(string $collection, array $query): bool
    {
        $mongolidConnection = $this->pool->getConnection();
        $connection = $mongolidConnection->getRawConnection();
        $database = $mongolidConnection->defaultDatabase;

        return (bool) $connection->$database->$collection->count($query);
    }