DynamoDB - Multiple range keys

Put a copy of B and C in the range field (as an extra column) and make that your range key like "B_C" and you can still also have separate columns for B and C if you need.


You can't have more than 2 fields as primary key in DynamoDB.

As a workaround you can create local secondary index for each field that you want to be a range key. But you will not be able to build query with multiple range keys simultaneously because DynamoDB can only use one index at a time.

Consider using filter expressions, you will probably end up using more read throughput (filtering is performed after data is received from db) than you need but get the desired results.