Skip to content

Commit 6c020a6

Browse files
philipbrownjenssegers
authored andcommitted
Remove the database from the dsn. (#971)
See mongodb/mongo-php-library#171
1 parent fecc60c commit 6c020a6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Jenssegers/Mongodb/Connection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ protected function getDsn(array $config)
185185
}
186186
}
187187

188-
return "mongodb://" . implode(',', $hosts) . "/{$database}";
188+
return "mongodb://" . implode(',', $hosts) . ($database? "/{$database}" : '');
189189
}
190190

191191
/**

0 commit comments

Comments
 (0)