From cc34f30bac9e8c74a99c04c25f6ba5e41a64747b Mon Sep 17 00:00:00 2001 From: Maksim Kotlyar Date: Fri, 2 Feb 2018 10:25:03 +0200 Subject: [PATCH] fix --- src/CollectionFactory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CollectionFactory.php b/src/CollectionFactory.php index a2dc635..c9c80be 100644 --- a/src/CollectionFactory.php +++ b/src/CollectionFactory.php @@ -25,7 +25,7 @@ public function __construct(Client $mongodb, string $mongoDsn) public function create(string $collectionName, string $databaseName = null, array $options = []): Collection { if (false == $databaseName) { - $databaseName = parse_url($this->mongoDsn, PHP_URL_PATH); + $databaseName = ltrim(parse_url($this->mongoDsn, PHP_URL_PATH), '/'); } if (false == $databaseName) {