From 6f1503a15a4edf4159310a9e66d8efda7814be19 Mon Sep 17 00:00:00 2001 From: adnen messaoudi <108982164+AdnenMess@users.noreply.github.com> Date: Tue, 26 Sep 2023 12:54:26 +0100 Subject: [PATCH] Update for multiple items add code on how to use multiple items --- Code/Module-08/Module8-Lambda-Code.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Code/Module-08/Module8-Lambda-Code.py b/Code/Module-08/Module8-Lambda-Code.py index 7b59fbc..3f2be7e 100644 --- a/Code/Module-08/Module8-Lambda-Code.py +++ b/Code/Module-08/Module8-Lambda-Code.py @@ -31,6 +31,14 @@ def lambda_handler(event, context): response = client.update_item(TableName='Customers', Key = customer_key, AttributeUpdates = ex_customer) + + # If we have multiple items the response will be : + # items = {'account_type': {'S': 'standard_user'}, 'username': {'S': 'johndoe'}, 'first_name': {'S': 'John'}} + # Specify the table name + # table_name = 'YourTableName' + # response = client.batch_write_item(RequestItems={table_name: items}) + + # Create Inventory Row #############################