I try to query my table Tinpon with a secondary index yielding a partition-key category and sort-key tinponId. My goal is
The KeyConditionExpression
doesn't allow not equals for the sort key. However, you can use the "Not Equals i.e. <>" in FilterExpression
.
KeyConditionExpression : 'category = :category',
FilterExpression : 'tinponId <> :tinponIdVal',
ExpressionAttributeValues : {
':category' : 'somevalue',
':tinponIdVal' : 'somevalue'
}