Skip to content

Commit b4550fc

Browse files
committed
DOCSP-43159: QB returns objects
1 parent 7551f76 commit b4550fc

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

docs/query-builder.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,20 @@ testability.
3838

3939
The {+odm-short+} provides the ``DB`` method ``table()`` to access a collection.
4040
Chain methods to specify commands and any constraints. Then, chain
41-
the ``get()`` method at the end to run the methods and retrieve the results.
41+
the ``get()`` method at the end to run the methods and retrieve the
42+
results. To retrieve only the first matching result, chain the
43+
``first()`` method instead of the ``get()`` method. Starting in
44+
{+odm-long+} v5.0, the query builder returns results as objects.
45+
4246
The following example shows the syntax of a query builder call:
4347

4448
.. code-block:: php
4549

4650
DB::table('<collection name>')
4751
// chain methods by using the "->" object operator
4852
->get();
49-
.. tip::
53+
54+
.. tip:: Set Database Connection
5055

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

0 commit comments

Comments
 (0)