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 个月前
相关内容
- AWS 官方已更新 5 个月前
- AWS 官方已更新 2 年前
- AWS 官方已更新 2 年前
- AWS 官方已更新 1 年前
Thank you for the answer,
But can I make an index on the Partition Key to use functions on that index ?