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
When using a schema with a field of type Map, attempting to do a findOneAndUpdate with both the setDefaultsOnInsert and upsert fields set to true causes a DollarPrefixedFieldName Mongo Error (code 52). This occurs even when both the findOneAndUpdate condition and update do not reference the Map field.
vkarpov15
added
confirmed-bug
We've confirmed this is a bug in Mongoose and will fix it.
and removed
has repro script
There is a repro script, the Mongoose devs need to confirm that it reproduces the issue
labels
Jun 22, 2019
Do you want to request a feature or report a bug?
Report a bug
What is the current behavior?
When using a schema with a field of type
Map
, attempting to do afindOneAndUpdate
with both thesetDefaultsOnInsert
andupsert
fields set totrue
causes aDollarPrefixedFieldName
Mongo Error (code 52). This occurs even when both thefindOneAndUpdate
condition and update do not reference theMap
field.See Codesandbox Demo.
What is the expected behavior?
The expected fields should be upserted into the DB and any defaults should be set. No error should occur.
What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
Node.js: v10.16.0
Mongoose: v5.6.0
MongoDB: v4.0.10
The text was updated successfully, but these errors were encountered: