Open Fasunle opened 1 year ago
Please, let me know if you need any further information to help you solve this bug
I dont have a solution to it but, I had updated my mongo server which cleared my DB and collections, as soon as imported them again the error went away.
So, it means it could be that my mongo server is obsolete. Interesting! I will try upgrading and see how it goes.
I faced the same error second time again, this was due to using an older version of mongoose(5.1.1) to create a new Objectid, updating it to v 7.0.3 resolved the issue. If someone could explain why does this error occur that would be awesome. All the best
I'm having the same problem. Followed @KDDeveloper 's suggestion and now I'm just getting "null" for ids. I'm using GraphQL and most of the time it's smart enough to convert _id to id, but now I have to do it manually.
I also had to upgrade to MongoDB 6.0 to fix the BSON types error. Deleting and re-adding collections did not fix the issue.
I was able to work-around this issue by forcing newer BSON and mongodb versions using this in my project's package.json file:
"overrides": { "mongoose": { "mongodb": "5.2.0", "bson": "5.2.0" }, "mongo-cursor-pagination": { "mongodb": "5.2.0", "bson": "5.2.0" } }
work around:
"resolutions": { "bson": "6.8.0", "mongo-cursor-pagination/bson": "6.8.0", "mongodb/bson": "6.8.0", "mongoose/mongodb/bson": "6.8.0" }
I will try to fix it with a PR.
Reproduce Bug
In order to reproduce this bug, use mongo-cursor-pagination (8.1.2 or 8.1.3) with mongoose (7.0.0).
The error occurs whenever next page query is added to paginate function.