-
Notifications
You must be signed in to change notification settings - Fork 1.5k
DOCSP-35976: Delete One usage example #2821
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM w/ a few suggestions
docs/usage-examples/deleteOne.txt
Outdated
You can delete a document in a collection by retrieving a single document and calling | ||
the ``delete()`` method on an Eloquent model or a query builder. | ||
|
||
Pass a query filter to the ``where()`` method, sort the matching documents, and call the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: Is "query filter" defined somewhere in these docs yet? If so, it might be good to link to that somewhere. (ie: "For more information about query filters, see ... ")
docs/usage-examples/deleteOne.txt
Outdated
Pass a query filter to the ``where()`` method, sort the matching documents, and call the | ||
``first()`` method to retrieve only the first document. Then, delete this matching document | ||
by calling the ``delete()`` method. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this paragraph could be more clear if it was presented as a list:
Pass a query filter to the ``where()`` method, sort the matching documents, and call the | |
``first()`` method to retrieve only the first document. Then, delete this matching document | |
by calling the ``delete()`` method. | |
Perform the following steps to delete a document: | |
1. Pass a query filter to the ``where()`` method | |
2. Sort the matching documents | |
3. Call the ``first()`` method to retrieve only the first document | |
4. Delete this matching document by calling the ``delete()`` method. |
Although, looking at the update usage example page, it looks like that might not be inline with the formatting being used in these docs. An alternative suggestion would be:
Pass a query filter to the ``where()`` method, sort the matching documents, and call the | |
``first()`` method to retrieve only the first document. Then, delete this matching document | |
by calling the ``delete()`` method. | |
To delete a document, pass a query filter to the ``where()`` method, sort the matching documents, and call the | |
``first()`` method to retrieve only the first document. Then, delete this matching document | |
by calling the ``delete()`` method. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Took your second suggestion!
docs/usage-examples/deleteOne.txt
Outdated
- Uses the ``Movie`` Eloquent model to represent the ``movies`` collection in the | ||
``sample_mflix`` database. | ||
- Deletes a document from the ``movies`` collection that matches a query filter. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should have a period on these since they're not full sentences (subject is in the intro)
- Uses the ``Movie`` Eloquent model to represent the ``movies`` collection in the | |
``sample_mflix`` database. | |
- Deletes a document from the ``movies`` collection that matches a query filter. | |
- Uses the ``Movie`` Eloquent model to represent the ``movies`` collection in the | |
``sample_mflix`` database. | |
- Deletes a document from the ``movies`` collection that matches a query filter. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feel free to double-check me on this one - I'm not 100% sure if we still consider it a fragment with the subject implied in the intro
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed - I think these are all fragments. Fixed!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we also need an example with the query builder, without retrieving the document.
I created a ticket to add query builder examples to these pages in the future |
Adds a usage example page demonstrating how to delete one document from a collection --------- Co-authored-by: norareidy <norareidy@users.noreply.github.com>
This PR adds a usage example page demonstrating how to delete one document from a collection
JIRA - https://jira.mongodb.org/browse/DOCSP-35976
Staging - https://preview-mongodbnorareidy.gatsbyjs.io/laravel/DOCSP-35976-staging/usage-examples/deleteOne/
Checklist