如何在 DyanamoDB 中创建带有 AttributeType Set、Map 或 JSON 的表。我不想通过插入 (PutItem) 或更新数据来创建表结构,因为我需要创建一个索引,该索引将包含投影中的 Map、List 或 JSON 属性。我需要做一个创建时间(CreateTable)。我也更喜欢使用 AWS CLI。下面是一个示例:
{
TableName : "Music",
KeySchema: [
{
AttributeName: "Artist",
KeyType: "HASH", //Partition key
}
],
AttributeDefinitions: [
{
AttributeName: "Artist",
AttributeType: "S"
},
{
AttributeName: "instruments"
AttributeType: // Map or List or JSON type
}
],
Run Code Online (Sandbox Code Playgroud)
... }