migrate-mongo icon indicating copy to clipboard operation
migrate-mongo copied to clipboard

Clarification around transactions

Open antony opened this issue 2 years ago • 1 comments

I was studying the mongo docs for an unrelated matter the other day, and I notice that using withTransaction requires you to pass thesession into each operation - https://docs.mongodb.com/v4.4/core/transactions/

I notice that in the readme for this module, you don't do that.

Is this an omission in the readme, or is there some magic which is auto-applying the session to each of the migration operations?

antony avatar Jul 15 '21 12:07 antony

yeah, i bumped into the same doc issue. I know that mongoose requires session parameter, when i bumped into migrate-mongo doc i was impressed how session can be read from arrow func context that does not have context by definition...

MikeKoval avatar Aug 17 '21 15:08 MikeKoval