File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ public function testOrWhere(): void
63
63
{
64
64
// begin query orWhere
65
65
$ result = DB ::connection ('mongodb ' )
66
- ->collection ('movies ' )
66
+ ->table ('movies ' )
67
67
->where ('id ' , new ObjectId ('573a1398f29313caabce9682 ' ))
68
68
->orWhere ('title ' , 'Back to the Future ' )
69
69
->get ();
Original file line number Diff line number Diff line change @@ -191,8 +191,12 @@ the value of the ``title`` field is ``"Back to the Future"``:
191
191
You can use the ``id`` alias in your queries to represent the
192
192
``_id`` field in MongoDB documents, as shown in the preceding
193
193
code. When you run a find operation 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.
194
+ automatically converts between ``id`` and ``_id``. This provides better
195
+ compatibility with Laravel, as the framework assumes that each record has a
196
+ primary key named ``id`` by default.
197
+
198
+ Because of this behavior, you cannot have two separate ``id`` and ``_id``
199
+ fields in your documents.
196
200
197
201
.. _laravel-query-builder-logical-and:
198
202
You can’t perform that action at this time.
0 commit comments