We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1574aff commit 99342a7Copy full SHA for 99342a7
src/Jenssegers/Mongodb/Connection.php
@@ -128,7 +128,7 @@ public function getDatabaseName()
128
protected function getDefaultDatabaseName($dsn, $config)
129
{
130
if (empty($config['database'])) {
131
- if (preg_match('/^mongodb:\\/\\/.+\\/([^?&]+)/s', $dsn, $matches)) {
+ if (preg_match('/^mongodb(?:[+]srv)?:\\/\\/.+\\/([^?&]+)/s', $dsn, $matches)) {
132
$config['database'] = $matches[1];
133
} else {
134
throw new InvalidArgumentException("Database is not properly configured.");
0 commit comments