@@ -17,12 +17,20 @@ Delete a Document
17
17
:depth: 1
18
18
:class: singlecol
19
19
20
- You can delete a document in a collection by retrieving a single Eloquent model and calling
21
- the ``delete()`` method, or by calling ``delete()`` directly on a query builder.
20
+ You can delete a document in a collection by retrieving a single
21
+ Eloquent model and calling the ``delete()`` method, or by calling
22
+ ``delete()`` directly on a query builder.
22
23
23
- To delete a document, pass a query filter to the ``where()`` method, sort the matching documents,
24
- and call the ``limit()`` method to retrieve only the first document. Then, delete this matching
25
- document by calling the ``delete()`` method.
24
+ To delete a document, pass a query filter to the ``where()`` method,
25
+ sort the matching documents, and call the ``limit()`` method to retrieve
26
+ only the first document. Then, delete this matching document by calling
27
+ the ``delete()`` method.
28
+
29
+ .. tip::
30
+
31
+ To learn more about deleting documents with the {+odm-short+}, see
32
+ the :ref:`laravel-fundamentals-delete-documents` section of the Write
33
+ Operations guide.
26
34
27
35
Example
28
36
-------
@@ -57,10 +65,3 @@ The example calls the following methods on the ``Movie`` model:
57
65
Deleted documents: 1
58
66
59
67
.. include:: /includes/usage-examples/fact-edit-laravel-app.rst
60
-
61
- .. tip::
62
-
63
- To learn more about deleting documents with the {+odm-short+}, see the `Deleting Models
64
- <https://laravel.com/docs/{+laravel-docs-version+}/eloquent#deleting-models>`__ section of the
65
- Laravel documentation.
66
-
0 commit comments