使用分区键和索引的DynamoDB搜索

问题描述 投票:0回答:1

我还没有看到使用分区键index(Python,boto方式)进行DynamoDB搜索的示例。是否可以直接指向任何链接/示例?

pyspark hive amazon-dynamodb boto3 amazon-emr
1个回答
0
投票
#import Key, Attr
#dynamodb=boto3.resource(....)
#table = dynamodb.resource('tablename')...
#usual stuff commented above

response = table.query(
    KeyConditionExpression=Key('hash_key').eq(hash_value),
    FilterExpression = Attr('column-name-that-has-an-index-NOT-THE-INDEX-NAME').eq(indexvalue)
)
© www.soinside.com 2019 - 2024. All rights reserved.