2 個答案
- 最新
- 最多得票
- 最多評論
2
As Jason states, you cannot use a function on the partition key. But you can add a GSI which can help your achieve the use-case. This blog post outlines how you can achieve that.
GSI data:
PK | PicturePK | Data |
---|---|---|
1 | 123 | Data |
1 | 321 | Data |
1 | 355 | Data |
QuerySpec spec = new QuerySpec()
.withKeyConditionExpression("PK = :pk AND begins_with(PicturePK, :v_prefix) ")
.withValueMap(new ValueMap()
.withString(":v_prefix", prefix)
.withNumber(":pk", "1"));
0
With a query the partition key must be specified exactly. Sort keys can use begins_with.
已回答 6 個月前
相關內容
- 已提問 1 年前
- AWS 官方已更新 1 年前
- AWS 官方已更新 2 年前
- AWS 官方已更新 2 年前
- AWS 官方已更新 3 個月前
Thank you for the answer,
But can I make an index on the Partition Key to use functions on that index ?