From the course: AWS for Developers: DynamoDB

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Insert data with transactions in DynamoDB using Node.js

Insert data with transactions in DynamoDB using Node.js - Amazon Web Services (AWS) Tutorial

From the course: AWS for Developers: DynamoDB

Start my 1-month free trial

Insert data with transactions in DynamoDB using Node.js

- [Instructor] Let's talk about transactions for a second. In my team.json file, I've got some team information here, but what happens if one record is corrupted. First, I cleared out my table. So I'm going to go ahead and scan it, just to show you that it's empty, and let's go ahead and return here to our teams.json folder, and let's mess up this last record for the New York Mets. Instead of Team ID, I'm putting team info, and instead of sort key, I'm just calling this, abbreviation. Now I have no partition key, and I have no sort key, so my code is going to confuse them how to insert this. I'm going to go ahead, and run my insert script again, and you see I got an error. Let's scan the table, and see if there's any data in it. There is. I got a partial result set, with some of the data in my file, but not all of it. Now because the data is small, we can see we're just missing the New York Mets, but imagine if this was thousands of entries and items here, and I don't know which one…

Contents