Transactions in Mongo

Hello following the course and there are quite few things that seem to be outdated. Definetly it seems like it needs a few updates, but one of the biggest questions for me is whats the best way to do transactions.

In the course we used fawn that was last updated 6 years ago. I think Mongoose has a way to do transactions now aswell? What would be the most current and best way to go about transactions with MongoDB?

PS. there has been one similar post before but even that seems outdated now …

1 Like

I have found exactly the same - some of the Mongoose and Joi syntax has changed and has needed a bit of research, but overall I still think the course is great.

Regarding transactions, Fawn is outdated and doesn’t seem to work with the latest version of MongoDB anyway. After a lot of research, I have concluded exactly the same as this post: [Mongoose] Transactions vs Fawn (Two Phase Commits) - #7 by mandatoryUserName

TL;DR you need a replica set in order to use transactions. Personally I decided life was too short and carried on with the rest of the course! Transactions and replica sets will be for future me if necessary…