Skip to content

Commit b01a972

Browse files
committed
Reverting DSN changes, issue mongodb#21
1 parent 9f0dddb commit b01a972

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: src/Jenssegers/Mongodb/Connection.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function __construct(array $config)
3737
$this->connection = new MongoClient($this->getDsn($config), $options);
3838

3939
// Select database
40-
$this->db = $this->connection->selectDB($config['database']);
40+
$this->db = $this->connection->{$config['database']};
4141
}
4242

4343
/**
@@ -130,7 +130,7 @@ protected function getDsn(array $config)
130130
$credentials = '';
131131
}
132132

133-
return "mongodb://{$credentials}" . implode(',', $hosts);
133+
return "mongodb://{$credentials}" . implode(',', $hosts) . "/{$database}";
134134
}
135135

136136
/**

0 commit comments

Comments
 (0)