File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -38,15 +38,20 @@ testability.
38
38
39
39
The {+odm-short+} provides the ``DB`` method ``table()`` to access a collection.
40
40
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
+
42
46
The following example shows the syntax of a query builder call:
43
47
44
48
.. code-block:: php
45
49
46
50
DB::table('<collection name>')
47
51
// chain methods by using the "->" object operator
48
52
->get();
49
- .. tip::
53
+
54
+ .. tip:: Set Database Connection
50
55
51
56
Before using the ``DB::table()`` method, ensure that you specify MongoDB as your application's
52
57
default database connection. For instructions on setting the database connection,
You can’t perform that action at this time.
0 commit comments