src/Validation/Rules.php
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);
    }
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);
    }
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 ) ; }
Run query on database and check for a result count.
Run query on database and check for a result count .