Our table has a composite primary key. There are a few use cases where we need to update the items based on just the partition key.
partitionKey sortKey
------------ ---------
10020525 208025117-xxxxx-153068323-208025401
10020525 208025117-208025475-153068323-208025401
Following is how I am currently updating: (Using Java)
UpdateItemRequest updateItemRequest = new UpdateItemRequest().withTableName("table").withKey(attMap);
UpdateItemResult updateItemResult = amazonDynamoDB.updateItem(updateItemRequest);
The 'attMap' already has the 'partitionKey' and 'sortKey'. Therefore, it does take care of updating the record matches the partition and sort key.
In a few cases (where there is a 'xxxxx' in the sort key), I want to update based on just the partitionKey.
Let me know if something is not clear. Would be happy to explain further.