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달 전
Thank you for the answer,
But can I make an index on the Partition Key to use functions on that index ?