I have a table like this:
Transports
| id (PK) | createDt | shipperId | carrierId | consigneeId |
|---|---|---|---|---|
| 1 | 23 | contact3 | contact2 | contact1 |
| 2 | 24 | contact1 | contact2 | contact3 |
| 3 | 28 | contact3 | contact2 | contact4 |
My access pattern is:
- find all transports where a contact was either shipper, carrier or consignee sorted by createDt. E.g. entering contact1 should return records 1, 2.
How can I do this in DyanomoDB?
I thought about creating a GSI. But then I need to create a separate GSI for each column, which would mean I need to join the query results on the columns myself. Perhaps there is an easier way.