Bug: TypeError: Cannot read property 'name' of undefined
at walkUpdatePath
#10512
Labels
confirmed-bug
We've confirmed this is a bug in Mongoose and will fix it.
Milestone
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
I ran into a weird issue while working with
.bulkWrite()
. I'm using nestjs and graphql and it appears that input objects coming in have anull
prototype.Here's an example via
console.log
of the update I'm attempting:Notice the
[Object: null prototype]
. This results in this error:The problem is on this line:
mongoose/lib/helpers/query/castUpdate.js
Line 203 in f1e0de1
If the current behavior is a bug, please provide the steps to reproduce.
Repro:
What is the expected behavior?
I can work around it in my code by doing something like
{ ...objWithNullPrototype }
instead, but this should probably not crash mongoose.What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
5.13.4
The text was updated successfully, but these errors were encountered: