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
I'm fighting with the following error when creating a document with the new operator:
TypeError: Cannot read property 'apply' of undefined
at q.reduce.post (/Users/simone/Enviroments/nodejs/target-manager-server/node_modules/mongoose/lib/document.js:1672:20)
at Array.reduce (native)
at model.Document.$__registerHooksFromSchema (/Users/simone/Enviroments/nodejs/target-manager-server/node_modules/mongoose/lib/document.js:1670:18)
at model.Document (/Users/simone/Enviroments/nodejs/target-manager-server/node_modules/mongoose/lib/document.js:76:8)
at model.Model (/Users/simone/Enviroments/nodejs/target-manager-server/node_modules/mongoose/lib/model.js:45:12)
at new model (/Users/simone/Enviroments/nodejs/target-manager-server/node_modules/mongoose/lib/model.js:2932:11)
at /Users/simone/Enviroments/nodejs/target-manager-server/node_modules/mongoose/lib/model.js:1744:22
at /Users/simone/Enviroments/nodejs/target-manager-server/node_modules/mongoose/node_modules/async/lib/async.js:570:21
at /Users/simone/Enviroments/nodejs/target-manager-server/node_modules/mongoose/node_modules/async/lib/async.js:249:17
at /Users/simone/Enviroments/nodejs/target-manager-server/node_modules/mongoose/node_modules/async/lib/async.js:125:13
at Array.forEach (native)
Since our application is using mongoose-schema-extend I was wondering if you have any tips.
Might it be that mongoose-schema-extend is not compatible with moongoose v.4 ?
Thanks a lot for your help!
Simone
The text was updated successfully, but these errors were encountered:
I have an updated on this. It seems that moongose-extend-schema is working properly till a 3rd level of extension, but at the 4th it breaks. E.g. A <- B <- C is ok, but A <- B <- C <- D is not working.
Thanks for your reply, sieira. If we can help in anyway then don't hesitate to ask.
I tried to deep dive into both modules (mongoose and yours) but I cannot understand why it breaks. Maybe it is the line where the deep-copy occurs, or maybe is the middleware/hooks from mongoose is changed...
If we would have the expertise to fix it then we would submit a pull request :)
Hi All :)
I'm fighting with the following error when creating a document with the new operator:
Since our application is using mongoose-schema-extend I was wondering if you have any tips.
Might it be that mongoose-schema-extend is not compatible with moongoose v.4 ?
Thanks a lot for your help!
Simone
The text was updated successfully, but these errors were encountered: