question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot read property '$isSingleNested' of undefined

See original GitHub issue

I suspect this is an issue with mongoose. I just upgraded from 4.4.2 to 4.5.9 and I get the following error:

info: ERROR IN RECEIVE MIDDLEWARE: TypeError: Cannot read property '$isSingleNested' of undefined

I believe my code that’s causing the issue is:

Model.update({ _id: foo._id }, {
    $inc: { "foo.bar.rofl": count },
    $set: {
        "foo.bar.last_message": Date.now(),
        "foo.stix": err || "ok"
    }
}, err => done(err));

Any ideas?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:6
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
loriscommented, Aug 18, 2016

Same here, since 4.5.9 (4.5.8 is fine). Having a look at the changelog, the culprit might be https://github.com/Automattic/mongoose/issues/4369

0reactions
vkarpov15commented, Aug 22, 2016

Duplicate of #4418, will push a fix tomorrow

Read more comments on GitHub >

github_iconTop Results From Across the Web

Mongoose Update error $isSingleNested - node.js
1 Answer 1 ... you cant set value directly. you need to set value to some field . you need to provide the...
Read more >
TypeError: Cannot read property 'close' of undefined - MongoDB
I had this problem, I t changed the connectTimeoutMS variable in mongoclient.spec.js to 2000 (this is defined twice in the file. make sure...
Read more >
cannot read properties of undefined (reading 'split') mongoose
Uncaught TypeError : Cannot read properties of undefined (reading 'split') at Object.<anonymous> (browser.umd.js:220) at Object.
Read more >
Cannot read property 'data' of undefined - Prismic People
I always get this error whenever i try to integrate meta document `TypeError: /Users/desartist22/Desktop/floema/views/_includes/head.pug:21 ...
Read more >
How to Avoid Getting 'Cannot read property of undefined' in ...
Learn how you can avoid getting the famous 'Cannot read property of undefined' error in JavaScript with the logical OR operator.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found