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 Im trying to inherit plaid into charge document in this way:
// widgetSession could either contain plaid or notconstwidgetSession=newWidgetSession({});console.log(widgetSession.plaid)// {}constsubscription=newSubscription({plaid: widgetSession.plaid});console.log(subscription.plaid)// MongooseDocument { undefined }constcharge=newCharge({});charge.set({plaid: subscription.plaid});
Im getting an error:
TypeError: Cannot convert undefined or null to object
at Function.keys (<anonymous>)
at model.$set (node_modules/mongoose/lib/document.js:867:21)
at model._handleIndex (node_modules/mongoose/lib/document.js:915:12)
at model.$set (node_modules/mongoose/lib/document.js:879:22)
at Context.<anonymous> (tests/unittests/models/subscription.spec.js:152:14)
at processImmediate (internal/timers.js:439:21)
at process.topLevelDomainCallback (domain.js:130:23)
What is the expected behavior? charge.set method does not end up in failure
What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
Node.js: 12.14.1
Mongoose: 5.8.11
MongoDB: 4.2.0
The text was updated successfully, but these errors were encountered:
vkarpov15
added
has repro script
There is a repro script, the Mongoose devs need to confirm that it reproduces the issue
and removed
needs repro script
Maybe a bug, but no repro script. The issue reporter should create a script that demos the issue
labels
Feb 19, 2020
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
Feb 20, 2020
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
Just migrated to
mongoose@5.8.11
frommongoose@5.4.4
andDocument.set
method failsIf the current behavior is a bug, please provide the steps to reproduce.
I have 3 models with schemas like these:
when Im trying to inherit
plaid
intocharge
document in this way:Im getting an error:
What is the expected behavior?
charge.set
method does not end up in failureWhat are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
Node.js: 12.14.1
Mongoose: 5.8.11
MongoDB: 4.2.0
The text was updated successfully, but these errors were encountered: