You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I create an object "property one" with a field data that has a mixed schema type, leave it empty, fetch that property from the database, set the data field, save it, create a second property ("property two"), leave the data field empty, save it to the database, then look it up, the data field is now populated with the same data as the first property.
My guess is that it's related to the lack of minimize: false.
Mongoose is behaving properly. The data field has its default set to a single object instance, therefore all documents will have their default data field set to this instance. If you'd like to use a different instance for each document, set the default to a function that returns an object literal.
If I create an object "property one" with a field
data
that has a mixed schema type, leave it empty, fetch that property from the database, set thedata
field, save it, create a second property ("property two"), leave the data field empty, save it to the database, then look it up, the data field is now populated with the same data as the first property.My guess is that it's related to the lack of minimize: false.
https://gist.github.com/azylman/5139583
The text was updated successfully, but these errors were encountered: