Skip to content

Merge 4.2 into 4.3 #2908

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 24, 2024
Merged
Changes from all commits
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
13 changes: 13 additions & 0 deletions docs/query-builder.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,19 @@ The following example shows the syntax of a query builder call:
DB::collection('<collection name>')
// chain methods by using the "->" object operator
->get();
.. tip::

Before using the ``DB::collection()`` method, ensure that you specify MongoDB as your application's
default database connection. For instructions on setting the database connection,
see the :ref:`laravel-quick-start-connect-to-mongodb` step in the Quick Start.

If MongoDB is not your application's default database, you can use the ``DB::connection()`` method
to specify a MongoDB connection. Pass the name of the connection to the ``connection()`` method,
as shown in the following code:

.. code-block:: php

$connection = DB::connection('mongodb');

This guide provides examples of the following types of query builder operations:

Expand Down