diff --git a/pkg/mongodb/MongodbConnectionFactory.php b/pkg/mongodb/MongodbConnectionFactory.php index 83c405afb..1bc2c2db1 100644 --- a/pkg/mongodb/MongodbConnectionFactory.php +++ b/pkg/mongodb/MongodbConnectionFactory.php @@ -35,6 +35,7 @@ public function __construct($config = 'mongodb:') } elseif (is_string($config)) { $config = $this->parseDsn($config); } elseif (is_array($config)) { + $config = $this->parseDsn(empty($config['dsn']) ? 'mongodb:' : $config['dsn']); } else { throw new \LogicException('The config must be either an array of options, a DSN string or null'); }