简体   繁体   中英

Correct Structure for Multiple Non-hierarchical Keys in DynamoDB

I'm looking for some advice on how to model a table in DynamoDB where I need to lookup on several different keys. The object looks like this:

{
  memberId: string;
  cognitoUserId: string;
  cognitoTmpPassword: string;
  email: string;
  britecoreGroupId: string;
  policyNumbers: string[];
}

We need to be able to perform lookups by memberId, cognitoUserId or email for different use cases. What is the optimal way to structure the table for this?

Thank you!

Ah, I think secondary indexes are what I need. All good.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM