Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ All notable changes to this project will be documented in this file.
## [4.8.0] - next

* Add `Query\Builder::incrementEach()` and `decrementEach()` methods by @SmallRuralDog in [#2550](https://github.com/mongodb/laravel-mongodb/pull/2550)
* Deprecate `Connection::collection()` and `Schema\Builder::collection()` methods by @GromNaN in [#3062](https://github.com/mongodb/laravel-mongodb/pull/3062)

## [4.7.0] - 2024-07-19

Expand Down
10 changes: 5 additions & 5 deletions docs/fundamentals/database-collection.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ create a database connection to the ``animals`` database in the

.. code-block:: php
:emphasize-lines: 1,8

'default' => 'mongodb',

'connections' => [
Expand All @@ -77,7 +77,7 @@ The following example shows how to specify multiple database connections
``plants`` databases:

.. code-block:: php

'connections' => [

'mongodb' => [
Expand Down Expand Up @@ -149,19 +149,19 @@ If you are unable to accomplish your operation by using an Eloquent
model, you can access the query builder by calling the ``collection()``
method on the ``DB`` facade. The following example shows the same query
as in the preceding example, but the query is constructed by using the
``DB::collection()`` method:
``DB::table()`` method:

.. code-block:: php

DB::connection('mongodb')
->collection('flowers')
->table('flowers')
->where('name', 'Water Lily')
->get()

List Collections
----------------

To see information about each of the collections in a database, call the
To see information about each of the collections in a database, call the
``listCollections()`` method.

The following example accesses a database connection, then
Expand Down
Loading