8000 Adding the database to the DSN we are sending to the MongoDB server · symfony/symfony@81d0552 · GitHub
[go: up one dir, main page]

Skip to content

Commit 81d0552

Browse files
committed
Adding the database to the DSN we are sending to the MongoDB server
1 parent 0d4b02e commit 81d0552

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/HttpKernel/Profiler/MongoDbProfilerStorage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ protected function getMongo()
114114
{
115115
if ($this->mongo === null) {
116116
if (preg_match('#^(mongodb://.*)/(.*)/(.*)$#', $this->dsn, $matches)) {
117-
$mongo = new \Mongo($matches[1]);
117+
$mongo = new \Mongo($matches[1] . (!empty($matches[2]) ? '/' . $matches[2] : ''));
118118
$database = $matches[2];
119119
$collection = $matches[3];
120120
$this->mongo = $mongo->selectCollection($database, $collection);

0 commit comments

Comments
 (0)
0