Secondary Indexes with UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'createCollection' of undefined #8534
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?
Possible bug
What is the current behavior?
Dependencies:
Update to anything above mongoose@5.7.11 (Trying 5.8.9 currently)
autoIndex
for this partcular Schema at https://github.com/OpenUserJS/OpenUserJS.org/blob/1261d161171f0558aa27d4de97f4a9a6c4fc9a15/models/script.js#L44-L46useUnifiedTopology
at https://github.com/OpenUserJS/OpenUserJS.org/blob/1261d161171f0558aa27d4de97f4a9a6c4fc9a15/app.js#L78 and https://github.com/OpenUserJS/OpenUserJS.org/blob/1261d161171f0558aa27d4de97f4a9a6c4fc9a15/app.js#L88 (Production vs Development)If the current behavior is a bug, please provide the steps to reproduce.
Update https://github.com/OpenUserJS/OpenUserJS.org/blob/1261d161171f0558aa27d4de97f4a9a6c4fc9a15/package.json#L41 to use
5.8.9
(or anything above5.7.11
)What is the expected behavior?
Print out the secondary indexes we add and not throw the
UnhandledPromiseRejectionWarning
event.What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
See dependency list links and code blocks above.
Been trying to figure this out for some weeks in spare time, even with some other issues regarding
.catch
which didn't work onconnect
, and I'm stumped. We can trap the globalUnhandledPromiseRejectionWarning
withprocess
but that doesn't seem to be the correct methodology. I assume, hopefully correct, that our secondary indexes aren't being synchronized with Mongo backend with this warning event.Thanks so much for your assistance.
The text was updated successfully, but these errors were encountered: