From 5f877df763cdbd2a3aeed04954f3c85fa0692c7f Mon Sep 17 00:00:00 2001 From: Michael Morisi Date: Thu, 27 Feb 2025 11:37:52 -0500 Subject: [PATCH 1/2] Rename Connection::getMongoDB to getDatabase --- docs/database-collection.txt | 2 +- docs/filesystems.txt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/database-collection.txt b/docs/database-collection.txt index fb6573147..d42a0d52a 100644 --- a/docs/database-collection.txt +++ b/docs/database-collection.txt @@ -225,7 +225,7 @@ the collections in the database: .. code-block:: php - $collections = DB::connection('mongodb')->getMongoDB()->listCollections(); + $collections = DB::connection('mongodb')->getDatabase()->listCollections(); List Collection Fields ---------------------- diff --git a/docs/filesystems.txt b/docs/filesystems.txt index 725b799af..3ec7ee41f 100644 --- a/docs/filesystems.txt +++ b/docs/filesystems.txt @@ -94,7 +94,7 @@ In this case, the options ``connection`` and ``database`` are ignored: 'driver' => 'gridfs', 'bucket' => static function (Application $app): Bucket { return $app['db']->connection('mongodb') - ->getMongoDB() + ->getDatabase() ->selectGridFSBucket([ 'bucketName' => 'avatars', 'chunkSizeBytes' => 261120, @@ -150,7 +150,7 @@ if you need to work with revisions, as shown in the following code: // Create a bucket service from the MongoDB connection /** @var \MongoDB\GridFS\Bucket $bucket */ - $bucket = $app['db']->connection('mongodb')->getMongoDB()->selectGridFSBucket(); + $bucket = $app['db']->connection('mongodb')->getDatabase()->selectGridFSBucket(); // Download the last but one version of a file $bucket->openDownloadStreamByName('hello.txt', ['revision' => -2]) From 4891b5b16ad7f19e9565152b6d5e412f94c74600 Mon Sep 17 00:00:00 2001 From: Michael Morisi Date: Thu, 27 Feb 2025 13:55:54 -0500 Subject: [PATCH 2/2] Jerome suggestion --- docs/database-collection.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/database-collection.txt b/docs/database-collection.txt index d42a0d52a..be081c97b 100644 --- a/docs/database-collection.txt +++ b/docs/database-collection.txt @@ -219,7 +219,7 @@ methods in your application: Example ``````` -The following example accesses a database connection, then calls the +The following example accesses the database of the connection, then calls the ``listCollections()`` query builder method to retrieve information about the collections in the database: