| 123456789101112131415161718192021 |
- import boto3
-
- def increase_rating(keya,dynamodb=None):
- if not dynamodb:
- dynamodb = boto3.resource('dynamodb')
- table = dynamodb.Table('hehe')
-
- response = table.update_item(
- Key={'name': keya},
- UpdateExpression="set alias=:val",
- ExpressionAttributeValues={
- ':val': 'hehe'},
- ReturnValues="UPDATED_NEW")
- return response
-
-
- if __name__ == '__main__':
- update_response = increase_rating("cxy")
- print("Update movie succeeded:")
|