Mongolid\Connection\Connection::findDefaultDatabase PHP Method

findDefaultDatabase() protected method

Find and stores the default database in the connection string.
protected findDefaultDatabase ( string $connectionString ) : void
$connectionString string MongoDB connection string.
return void
    protected function findDefaultDatabase(string $connectionString)
    {
        preg_match('/\\S+\\/(\\w*)/', $connectionString, $matches);
        if ($matches[1] ?? null) {
            $this->defaultDatabase = $matches[1];
        }
    }