We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9f0dddb commit b01a972Copy full SHA for b01a972
src/Jenssegers/Mongodb/Connection.php
@@ -37,7 +37,7 @@ public function __construct(array $config)
37
$this->connection = new MongoClient($this->getDsn($config), $options);
38
39
// Select database
40
- $this->db = $this->connection->selectDB($config['database']);
+ $this->db = $this->connection->{$config['database']};
41
}
42
43
/**
@@ -130,7 +130,7 @@ protected function getDsn(array $config)
130
$credentials = '';
131
132
133
- return "mongodb://{$credentials}" . implode(',', $hosts);
+ return "mongodb://{$credentials}" . implode(',', $hosts) . "/{$database}";
134
135
136
0 commit comments