MongoExpiredSessionError: Cannot use a session that has ended
when using Model.collection.find_.populate
#15195
Labels
can't reproduce
Mongoose devs have been unable to reproduce this issue. Close after 14 days of inactivity.
Prerequisites
Mongoose version
8.9.x
Node.js version
22.x
MongoDB server version
7
Typescript version (if applicable)
No response
Description
When using Model.collection.findOne.populate(....) the Driver shutdown the session that running and end up with
MongoExpiredSessionError: Cannot use a session that has ended
here's the full exception:
Don't know if it's possible to use .populate with .collection methods or not, but the error is not an obvious one and should be more clear
Steps to Reproduce
Say we have a collection named
Schools
and another one namedClasses
the exception will occur
Expected Behavior
No response
The text was updated successfully, but these errors were encountered: