You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Do you want to request a feature or report a bug?
Request a feature / Report a bug (not sure what expected behaviour is for this specific cse)
What is the current behavior? MongoError: Use of expired sessions is not permitted is thrown when populating a document that was created in a session (See the src/index.ts in the repo below for an easy to read example).
If the current behavior is a bug, please provide the steps to reproduce.
model A and model B exist such that model A has a ref to model B
start a session & transaction
create a document using model B, then a document using model A with the reference (ObjectId) to the B document
commit the transaction & end the session
try to populate the instance of B on A
error
To avoid this, one can simply use the existing B doc when creating A instead of using B's id and a reference. However, this error is actually thrown if any of the subdocuments of B on A are populated as well (e.g if B had a C and we tried to populate C).
What is the expected behavior?
I understand that because A and B were created in a session, that subsequent writes that occur once the session has ended will still be "linked" to a dead session and that's what's throwing the error here. However, I feel like there should be an easy way to detach a document from a session (especially since the session successfully ended).
What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
Versions are visible in the repo attached.
The text was updated successfully, but these errors were encountered:
Do you want to request a feature or report a bug?
Request a feature / Report a bug (not sure what expected behaviour is for this specific cse)
What is the current behavior?
MongoError: Use of expired sessions is not permitted
is thrown when populating a document that was created in a session (See the src/index.ts in the repo below for an easy to read example).If the current behavior is a bug, please provide the steps to reproduce.
repo for repro
To avoid this, one can simply use the existing B doc when creating A instead of using B's id and a reference. However, this error is actually thrown if any of the subdocuments of B on A are populated as well (e.g if B had a C and we tried to populate C).
What is the expected behavior?
I understand that because A and B were created in a session, that subsequent writes that occur once the session has ended will still be "linked" to a dead session and that's what's throwing the error here. However, I feel like there should be an easy way to detach a document from a session (especially since the session successfully ended).
What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
Versions are visible in the repo attached.
The text was updated successfully, but these errors were encountered: