seppevs / migrate-mongo

A database migration tool for MongoDB in Node
MIT License
926 stars 163 forks source link

Clarification around transactions #382

Closed antony closed 1 year ago

antony commented 3 years ago

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?

MikeKoval commented 3 years ago

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...