Closed boomfly closed 2 years ago
We need to modify .save method to accept session option to it. Collection.save({session}) I use this helper function for handling transactions:
.save
session
Collection.save({session})
storeWithSession = (doc, session) -> collection = doc.constructor.getCollection().rawCollection() if doc._isNew await collection.insertOne { ...doc.raw() _id: Random.id() }, {session} else await collection.updateOne {_id: doc._id}, doc.getModifier(), {session}
@lukejagodzinski
I'm not developing this library anymore. I only do bug fixes.
We need to modify
.save
method to acceptsession
option to it.Collection.save({session})
I use this helper function for handling transactions: