Assume the following table, A is partition key, B is sort key:
A B C
a1 b1 c1
a1 b2 c1
a1 b3 c1
a1 b4 c2
If queried with KeyConditionExpression A=a1, ProjectionExpression C,
return would be [c1, c1, c1, c2].
But I would like it to be [c1, c2], i.e. remove the duplicate c1.
How to do it?
As far as I know this is currently not possible.
Also, compared to removing duplicates by yourself after you received the result, would be a smaller result set is (and therefore maybe a little faster transmission). Even if it was possible the query would consume the same throughput capacity because DynamoDB internally would also need to query all results and then remove duplicates.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With