Skip to content

Commit 00e882d

Browse files
committed
rebase to v4.6, add content back
1 parent b0c3a95 commit 00e882d

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

docs/includes/query-builder/QueryBuilderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function testOrWhere(): void
6363
// begin query orWhere
6464
$result = DB::connection('mongodb')
6565
->collection('movies')
66-
->where('year', 1955)
66+
->where('id', new ObjectId('573a1398f29313caabce9682'))
6767
->orWhere('title', 'Back to the Future')
6868
->get();
6969
// end query orWhere

docs/query-builder.txt

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,15 +176,24 @@ Logical OR Example
176176

177177
The following example shows how to chain the ``orWhere()``
178178
query builder method to retrieve documents from the
179-
``movies`` collection that either match the ``year``
180-
value of ``1955`` or match the ``title`` value ``"Back to the Future"``:
179+
``movies`` collection in which the value of the ``_id``
180+
field is ``ObjectId('573a1398f29313caabce9682')`` or
181+
the value of the ``title`` field is ``"Back to the Future"``:
181182

182183
.. literalinclude:: /includes/query-builder/QueryBuilderTest.php
183184
:language: php
184185
:dedent:
185186
:start-after: begin query orWhere
186187
:end-before: end query orWhere
187188

189+
.. note:: id Alias
190+
191+
Starting in v4.6, you can use the ``id`` alias in your queries to represent
192+
the ``_id`` field in MongoDB documents, as shown in the preceding
193+
code. When you run a find operation by using the query builder, {+odm-short+}
194+
automatically converts between ``id`` and ``_id``. Because of this behavior,
195+
you cannot have two separate ``id`` and ``_id`` fields in your documents.
196+
188197
.. _laravel-query-builder-logical-and:
189198

190199
Logical AND Example

0 commit comments

Comments
 (0)