We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 1574aff + 99342a7 commit 01dfe3cCopy full SHA for 01dfe3c
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