如何使用boto3从dynamoDB获取最后插入的记录?

时间:2019-03-05 13:07:17

标签: python amazon-dynamodb boto3

如何使用boto3从dynamoDB获取最后插入的记录?

1 个答案:

答案 0 :(得分:0)

在执行以下操作之前,请确保运行$ aws configure并插入您的凭据:

import boto3
from boto3.dynamodb.conditions import Key, Attr

dynamodb = boto3.resource('dynamodb')
table = dynamodb.Table('Your_Table')

response = table.query(
    KeyConditionExpression=Key('entry').eq('latest_entry_identifier'))
items = response['Items']
print(items)
相关问题