-
Notifications
You must be signed in to change notification settings - Fork 137
Transcation #258
Comments
i know this is a bit old, but: |
I'm currently investigating this for release 6.0.0, but it seems like this cannot/should not be implemented in typegoose, here are the reasons:
full example (needs Replica Set connection): const session = await mongoose.startSession();
session.startTransaction();
await somemodel.create({}, { session });
await somemodel.find({}, { session });
await session.commitTransaction(): TL;DR: "wontfix" & removing from 6.0.0 spec (this can be closed) |
This comment has been minimized.
This comment has been minimized.
Hey, maybe coming a lit late, but just to people arrive here looking for typegoose transactions, i have an example may you can use.
ofc you can turn this into async await., just follow the same logic |
why are we using the object reference in the constructor when reading/modifying data? If I have other unrelated queries that use the same object and then I abort my transaction, won't that abort all other operations as well? |
Add on functionality of transaction which mongoose has provide
https://mongoosejs.com/docs/transactions.html
The text was updated successfully, but these errors were encountered: