O'Reilly logo

Serverless Single Page Apps by Ben Rady

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Saving Documents

Now that we’ve created our table and authorized our app to connect to it, let’s save some data. When the user enters a correct answer, we’re going to save it. If they return to this problem later, we’ll show them the correct answer they entered before. To add this functionality to the app, you’ll first need to change the click handler in the problem view to capture the user input and create an object. Then we’ll see how to save that object to DynamoDB.

When writing objects to DynamoDB, we can use the DynamoDB.DocumentClient to interact with DynamoDB like a document database. The objects we store are represented as items with the object properties as attributes, and the values can be either primitive values likes Strings and ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required