@@ -32,81 +32,37 @@ by passing your intended document changes to the ``update()`` method.
3232Example
3333-------
3434
35- Select from the following :guilabel:`Eloquent` and :guilabel:`Query
36- Builder` tabs to view usage examples for the same operation that use
37- each corresponding query syntax:
38-
39- .. tabs::
40-
41- .. tab:: Eloquent
42- :tabid: eloquent-model-count
43-
44- This example performs the following actions:
45-
46- - Uses the ``Movie`` Eloquent model to represent the ``movies``
47- collection in the ``sample_mflix`` database
48- - Updates a document from the ``movies`` collection that matches
49- the query filter
50- - Prints the number of updated documents
51-
52- The example calls the following methods on the ``Movie`` model:
53-
54- - ``where()``: Matches documents in which the value of the
55- ``title`` field is ``"Carol"``
56- - ``orderBy()``: Sorts matched documents by their ascending ``_id`` values
57- - ``first()``: Retrieves only the first matching document.
58- - ``update()``: Updates the value of the ``imdb.rating`` nested
59- field to from ``6.9`` to ``7.3`` and the value of the
60- ``imdb.votes`` nested field from ``493`` to ``142000``
61-
62- .. io-code-block::
63- :copyable: true
64-
65- .. input:: ../includes/usage-examples/UpdateOneTest.php
66- :start-after: begin-eloquent-update-one
67- :end-before: end-eloquent-update-one
68- :language: php
69- :dedent:
70-
71- .. output::
72- :language: console
73- :visible: false
35+ This example performs the following actions:
7436
75- Updated documents: 1
76-
77- .. tab:: Query Builder
78- :tabid: query-builder-count
79-
80- This example performs the following actions:
81-
82- - Accesses the ``movies`` collection by calling the ``table()``
83- method from the ``DB`` facade
84- - Updates a document from the ``movies`` collection that matches
85- the query filter
86- - Prints the number of updated documents
87-
88- The example calls the following query builder methods:
89-
90- - ``where()``: Matches documents in which the value of the
91- ``title`` field is ``"Carol"``
92- - ``orderBy()``: Sorts matched documents by their ascending ``_id`` values
93- - ``first()``: Retrieves only the first matching document.
94- - ``update()``: Updates the value of the ``imdb.rating`` nested
95- field to from ``6.9`` to ``7.3`` and the value of the
96- ``imdb.votes`` nested field from ``493`` to ``142000``
97-
98- .. io-code-block::
99-
100- .. input:: ../includes/usage-examples/UpdateOneTest.php
101- :start-after: begin-qb-update-one
102- :end-before: end-qb-update-one
103- :language: php
104- :dedent:
105-
106- .. output::
107- :language: console
108- :visible: false
109-
110- Updated documents: 1
37+ - Uses the ``Movie`` Eloquent model to represent the ``movies``
38+ collection in the ``sample_mflix`` database
39+ - Updates a document from the ``movies`` collection that matches
40+ the query filter
41+ - Prints the number of updated documents
42+
43+ The example calls the following methods on the ``Movie`` model:
44+
45+ - ``where()``: Matches documents in which the value of the
46+ ``title`` field is ``"Carol"``
47+ - ``orderBy()``: Sorts matched documents by their ascending ``_id`` values
48+ - ``first()``: Retrieves only the first matching document.
49+ - ``update()``: Updates the value of the ``imdb.rating`` nested
50+ field to from ``6.9`` to ``7.3`` and the value of the
51+ ``imdb.votes`` nested field from ``493`` to ``142000``
52+
53+ .. io-code-block::
54+ :copyable: true
55+
56+ .. input:: ../includes/usage-examples/UpdateOneTest.php
57+ :start-after: begin-eloquent-update-one
58+ :end-before: end-eloquent-update-one
59+ :language: php
60+ :dedent:
61+
62+ .. output::
63+ :language: console
64+ :visible: false
65+
66+ Updated documents: 1
11167
11268.. include:: /includes/usage-examples/fact-edit-laravel-app.rst
0 commit comments