I have a DynamoDB table called Message with the following attributes:
message_id
: number (partition key)user_id
: number (sort key)incoming
: booleansubject
: string
I want to create a global secondary index with user_id
for the partition key, and the combined value of incoming
and subject
for the sort key.
Global secondary index:
user_id
: partition keyincoming#subject
: sort key
Do I have to manually cast the incoming
attribute to a string (where true
becomes "1"
, and false
becomes "0"
) before combining it with subject
? What is the standard way to handle such a scenario?