Closed 4ty711 closed 2 years ago
https://mongoosejs.com/docs/migrating_to_6.html
Mongoose 6 has several backwards breaking changes. Check if one of them is in your project, if not then provide a reproduction script because this issue does not have enough information to create one.
I have the same issue on Mongoose 5 after updating to 5.13.12.
@cbratschi can you please provide a script that demonstrates this issue?
This happens to me when using jest.mock
on multiple modules that end up depending on mongoose
.
Sorry I don't have time to provide a repo.
@amatiasq we strongly recommend using any testing framework other than Jest. Without a repro, there's no way for us to provide any advice other than to:
Do you want to request a feature or report a bug? bug
What is the current behavior?
I am getting: TypeError: Cannot read property 'Decimal128' of null
If the current behavior is a bug, please provide the steps to reproduce.
Install the latest version of mongoose and use the ObjectID Constructor.
What is the expected behavior?
In older versions, the path is correct.
What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.