@@ -66,8 +66,8 @@ The following example shows the syntax of a query builder call:
66
66
67
67
This guide provides examples of the following types of query builder operations:
68
68
69
- - :ref:`laravel-options-query-builder`
70
69
- :ref:`laravel-retrieve-query-builder`
70
+ - :ref:`laravel-options-query-builder`
71
71
- :ref:`laravel-modify-results-query-builder`
72
72
- :ref:`laravel-mongodb-read-query-builder`
73
73
- :ref:`laravel-mongodb-write-query-builder`
@@ -86,33 +86,6 @@ of the Quick Start.
86
86
To perform read and write operations by using the query builder, import the
87
87
``Illuminate\Support\Facades\DB`` facade and compose your query.
88
88
89
- .. _laravel-options-query-builder:
90
-
91
- Set Query-Level Options
92
- -----------------------
93
-
94
- You can modify the way that the {+odm-short+} performs queries by
95
- setting options on the query builder. You can pass an array of options
96
- to the ``options()`` query builder method to specify options for the
97
- query.
98
-
99
- The following code demonstrates how to attach a comment to
100
- a query:
101
-
102
- .. literalinclude:: /includes/query-builder/QueryBuilderTest.php
103
- :language: php
104
- :dedent:
105
- :start-after: begin options
106
- :end-before: end options
107
-
108
- The query builder accepts the same options that you can set for
109
- the :phpmethod:`find() <phpmethod.MongoDB\\Collection::find()>` method in the
110
- {+php-library+}. Some of the options to modify query results, such as
111
- ``skip``, ``sort``, and ``limit``, are settable directly as query
112
- builder methods and are described in the
113
- :ref:`laravel-modify-results-query-builder` section of this guide. We
114
- recommend that you use these methods instead of passing them as options.
115
-
116
89
.. _laravel-retrieve-query-builder:
117
90
118
91
Retrieve Matching Documents
@@ -638,6 +611,33 @@ value of ``imdb.rating`` of those matches by using the
638
611
:start-after: begin aggregation with filter
639
612
:end-before: end aggregation with filter
640
613
614
+ .. _laravel-options-query-builder:
615
+
616
+ Set Query-Level Options
617
+ -----------------------
618
+
619
+ You can modify the way that the {+odm-short+} performs operations by
620
+ setting options on the query builder. You can pass an array of options
621
+ to the ``options()`` query builder method to specify options for the
622
+ query.
623
+
624
+ The following code demonstrates how to attach a comment to
625
+ a query:
626
+
627
+ .. literalinclude:: /includes/query-builder/QueryBuilderTest.php
628
+ :language: php
629
+ :dedent:
630
+ :start-after: begin options
631
+ :end-before: end options
632
+
633
+ The query builder accepts the same options that you can set for
634
+ the :phpmethod:`find() <phpmethod.MongoDB\\Collection::find()>` method in the
635
+ {+php-library+}. Some of the options to modify query results, such as
636
+ ``skip``, ``sort``, and ``limit``, are settable directly as query
637
+ builder methods and are described in the
638
+ :ref:`laravel-modify-results-query-builder` section of this guide. We
639
+ recommend that you use these methods instead of passing them as options.
640
+
641
641
.. _laravel-modify-results-query-builder:
642
642
643
643
Modify Query Results
0 commit comments