Skip to content

Commit bc796ce

Browse files
committed
Replace selectDatabase with getDatabase
1 parent 85c5d57 commit bc796ce

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Connection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public function __construct(array $config)
7171
$this->database = $this->getDefaultDatabaseName($dsn, $config);
7272

7373
// Select database
74-
$this->db = $this->connection->selectDatabase($this->database);
74+
$this->db = $this->connection->getDatabase($this->database);
7575

7676
$this->tablePrefix = $config['prefix'] ?? '';
7777

@@ -139,7 +139,7 @@ public function getMongoDB()
139139
public function getDatabase(?string $name = null): Database
140140
{
141141
if ($name && $name !== $this->database) {
142-
return $this->connection->{$name};
142+
return $this->connection->getDatabase($name);
143143
}
144144

145145
return $this->db;

src/MongoDBServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ private function registerFlysystemAdapter(): void
133133
}
134134

135135
$bucket = $connection->getClient()
136-
->selectDatabase($config['database'] ?? $connection->getDatabaseName())
136+
->getDatabase($config['database'] ?? $connection->getDatabaseName())
137137
->selectGridFSBucket(['bucketName' => $config['bucket'] ?? 'fs', 'disableMD5' => true]);
138138
}
139139

0 commit comments

Comments
 (0)