-
-
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
fix(model): make exists(...) return lean document with _id
or null
instead of boolean
#11142
Conversation
…nt or null instead of boolean
This reverts commit b41cd1e.
This will definitely be a breaking change. I know a codebase where exists is checked to be a resolved boolean. |
@Uzlopak @vkarpov15 What do you think is the best action here? I think we can ship it in a minor release and make a note about it. |
I'll merge this into the 6.2 branch in the interest of caution. This is a messy case where the docs say one thing, the TypeScript bindings say something else, and the actual behavior is inconsistent between the two. So let's put this in a minor release to minimize risk, but also make it so the actual behavior and TS bindings match what is in our docs. |
https://mongoosejs.com/docs/migrating_to_6.html is still missing this breaking change. |
re #11138