1回答
- 新しい順
- 投票が多い順
- コメントが多い順
3
The short answer is its not possible to do what you are trying, you must return the entire map.
Second, your read request unit will charge you for the entire read of the item, regardless which fields are returned.
Depending on your application needs, you may benefit from remodeling your schema:
PK | SK | Other |
---|---|---|
apple | OWNER#Adam | Data |
apple | OWNER#Eve | Data |
apple | OWNER#Samuel | Data |
apple | OWNER#Lee | Data |
orange | OWNER#Dave | Data |
orange | OWNER#Matthew | Data |
orange | OWNER#Sarah | Data |
orange | OWNER#Ben | Data |
Now you can simply Query
with PK=apple
& Limit=5
dynamodb.query({
"TableName": 'Fruits',
"KeyConditionExpression": `#pk = :val`,
"ExpressionAttributeNames": {
"#pk": "PK"
},
"ExpressionAttributeValues": {
":val": { "S": "apple" }
},
"Limit": 5
})
関連するコンテンツ
- AWS公式更新しました 9ヶ月前