Skip to content

DOCSP-43159: QB returns objects #3135

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
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