Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dynamodb = boto3.resource('dynamodb')
- table = dynamodb.Table(ddb_table)
- table.put_item(
- Item={
- 'device_id': event['clientId'],
- 'timestamp': str(event['timestamp']),
- 'status': event['eventType']
- },
- ConditionExpression=':ts >= #ts_old OR attribute_not_exists(#ts_old)',
- ExpressionAttributeValues={':ts': str(event['timestamp']) },
- ExpressionAttributeNames={'#ts_old': 'timestamp'}
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement