Combine multiple base table attributes to form a DynamoDB GSI PK/SK

0

I am trying to create a GSI on a DynamoDB Table using AWS console by choosing PK or SK as combination of multiple base table attributes. However, none of the below formats are working for either PK or SK. Please guide me where I am doing wrong ?

  1. <custid>#<userid>
  2. [custid]#[userid]
  3. CUST#<custid>#USER#<userid>
  4. CUST#[custid]#USER#[userid]

Base Table has attributes: id (PK) (string), custid (string), userid (string)

#2 - Reference link(s): https://repost.aws/knowledge-center/dynamodb-create-composite-key https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/bp-sort-keys.html

#1,#3 - Reference link(s): https://www.alexdebrie.com/posts/dynamodb-one-to-many/#denormalization-by-using-a-complex-attribute:~:text=ORG%23%3COrgName%3E%23USER%23%3CUserName%3E

Mani
질문됨 3달 전123회 조회
1개 답변
1
수락된 답변

DynamoDB won't handle this for you. You'll need to construct the concatenated value on the application side and store as its own attribute in the base table.

답변함 3달 전
profile picture
전문가
검토됨 2달 전
  • I guess you are right. Thanks!

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠