简体   繁体   中英

How to fetch last inserted record from dynamoDB using boto3?

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

Before doing the following, be sure to run $ aws configure and insert your credentials:

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)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM