Skip to content
Merged
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
9 changes: 7 additions & 2 deletions docs/query-builder.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,20 @@ testability.

The {+odm-short+} provides the ``DB`` method ``table()`` to access a collection.
Chain methods to specify commands and any constraints. Then, chain
the ``get()`` method at the end to run the methods and retrieve the results.
the ``get()`` method at the end to run the methods and retrieve the
results. To retrieve only the first matching result, chain the
``first()`` method instead of the ``get()`` method. Starting in
{+odm-long+} v5.0, the query builder returns results as objects.

The following example shows the syntax of a query builder call:

.. code-block:: php

DB::table('<collection name>')
// chain methods by using the "->" object operator
->get();
.. tip::

.. tip:: Set Database Connection

Before using the ``DB::table()`` method, ensure that you specify MongoDB as your application's
default database connection. For instructions on setting the database connection,
Expand Down
Loading