From the course: MongoDB Node.js Developer Associate Cert Prep
Unlock this course with a free trial
Join today to access over 24,900 courses taught by industry experts.
Using transactions in MongoDB
From the course: MongoDB Node.js Developer Associate Cert Prep
Using transactions in MongoDB
- In this video, we're going to learn how to use multi document transactions in MongoDB. We'll use the Shell to complete a multi document transaction as well as abort a multi document transaction. It's highly likely that you'll use transactions inside of one of Mongo DB's drivers instead of here in the shell. While the language and the syntax will be a little bit different, the steps will be very similar to what you'll use in this video. In this scenario, we'll create a transaction for the transfer of funds from one customer accounts to another's. Let's go ahead and take a look at our first account. This will be account ending in 6066 for Naja Peterson, and we can see that they have an account balance of 2891. Let's then go and take a look at our second account that we'll be working with today. This is going to be account 4500, and this person, Florence Taylor, also has an account balance of 2598. We're going to go…