Saving a document that was fetched with .select() causes not selected array to be saved empty #12414
Closed
2 tasks done
Labels
confirmed-bug
We've confirmed this is a bug in Mongoose and will fix it.
Milestone
Prerequisites
Mongoose version
6.5.2
Node.js version
16.x
MongoDB server version
5.0.6
Description
This seems to have been changed from version 6.2.2 and 6.2.3. Still an issue in 6.6.0.
For the given schema if we try to retrieve a document
and then imminently save it the following update query is created
This is weird since I never selected or have touch that value.
Steps to Reproduce
Expected Behavior
I would expect non selected sub array not to update.
The text was updated successfully, but these errors were encountered: