Created
January 7, 2021 20:26
-
-
Save reisjr/02a5167193f97c11cf9dc919e1254803 to your computer and use it in GitHub Desktop.
DynamoDB Snippets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import boto3 | |
ddb_cli = boto3.client('dynamodb') | |
ddb_cli.update_item(TableName='Table1', | |
Key={'Pk': {'S': 'foo'}, 'Sk': {'S': 'bar'}}, | |
UpdateExpression='SET st.#k1 = :v1', | |
ExpressionAttributeNames={'#k1': '0'}, | |
ExpressionAttributeValues={':v1': {'M': {'t': {'N': '0' | |
}, 'l': {'S': 'label'}}}}) | |
ddb_cli.update_item(TableName='Table1', | |
Key={'Pk': {'S': 'foo'}, 'Sk': {'S': 'foo'}}, | |
UpdateExpression='SET st = :v1', | |
ExpressionAttributeValues={':v1': {'M': {'0': {'M': {'t': {'N': '0' | |
}, 'l': {'S': 'label'}}}}}}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment