I am so beginner.
I have studied AWS and got a some question.
import boto3
from boto3.dynamodb.conditions import Key
boto3 is the AWS SDK library for Python.
The "resources" interface allows for a higher-level abstraction than the low-level client interface.
dynamodb = boto3.resource('dynamodb', region_name='us-east-1')
table = dynamodb.Table('Books')
When making a Query API call, we use the KeyConditionExpression parameter to specify the hash key on which we want to query.
We're using the Key object from the Boto3 library to specify that we want the attribute name ("Author")
to equal "John Grisham" by using the ".eq()" method.
resp = table.query(KeyConditionExpression=Key('Author').eq("John Grisham"))
print("The query returned the following items:")
for item in resp['Items']:
print(item)
In this page, they gave me example code.
And, I wonder how to retrieve multiple items from this code.
I understand
resp = table.query(KeyConditionExpression=Key('Author').eq('John Grisham'))
this code is meaning for 'finding Author = Grisham '
I tried to modify it but, couldn't do ..
so Can you help me...?
question from:
https://stackoverflow.com/questions/66059027/i-wonder-how-to-retrieve-multiple-items-from-this-code 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…