-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Inconsistent documentation on remove/deleteOne #15107
Comments
Re: As for documentation referencing |
…e(), clarify that deleteOne() does not execute until then() or exec() Fix #15107
docs(connection+document+model): remove remaining references to remove(), clarify that deleteOne() does not execute until then() or exec()
Prerequisites
Mongoose version
8.9.0
Node.js version
20.0
MongoDB server version
7.0
Typescript version (if applicable)
No response
Description
The documentation on mongoose is inconsistent since the
prototype.remove()
has been removed in mongoose 7.x. The migration guide ( https://mongoosejs.com/docs/migrating_to_7.html#removed-remove ) note thatremove()
has been removed and replaced bydeleteOne()
and notes for documents:The Document API ( https://mongoosejs.com/docs/api/document.html ) does not include the deleteOne function. Moreover, the documentation still contains reference to
remove()
: for instance in the documentation of$isdeleted
( https://mongoosejs.com/docs/api/document.html#Document.prototype.$isDeleted() ) but there are more.Steps to Reproduce
Expected Behavior
functions referenced in the migration guide are expected to be documented.
In particular, I am running into an issue where a call to
Document.deleteOne()
is not reflected in the database unless I.then()
the query. It is unclear whether this is expected behavior or not. The documentation should clarify.The text was updated successfully, but these errors were encountered: