【发布时间】:2026-02-08 18:50:02
【问题描述】:
我是 DynmaoDB 的 updateTable,根据文档,如果我们要创建多个全局二级索引 (GSI),我们需要在“GlobalSecondaryIndexUpdates”字段中有多个对象,所以我传递了以下参数,但不会更新 GSI;但是,如果我只是创建一个 GSI(在“GlobalSecondaryIndexUpdates”字段中传递一个对象,它可以工作);这是我为创建多个 GSI 传递的参数:
{
"TableName": "movies",
"AttributeDefinitions": [{
"AttributeName": "id",
"AttributeType": "N"
}, {
"AttributeName": "title",
"AttributeType": "S"
}, {
"AttributeName": "subtitle",
"AttributeType": "S"
}],
"GlobalSecondaryIndexUpdates": [{
"Create": {
"IndexName": "title",
"ProvisionedThroughput": {
"ReadCapacityUnits": "5",
"WriteCapacityUnits": "5"
},
"KeySchema": [{
"AttributeName": "title",
"KeyType": "HASH"
}],
"Projection": {
"ProjectionType": "ALL"
}
}
}, {
"Create": {
"IndexName": "subtitle",
"ProvisionedThroughput": {
"ReadCapacityUnits": "5",
"WriteCapacityUnits": "5"
},
"KeySchema": [{
"AttributeName": "subtitle",
"KeyType": "HASH"
}],
"Projection": {
"ProjectionType": "ALL"
}
}
}]
}
我是否以错误的格式传递参数?
【问题讨论】:
标签: amazon-web-services amazon-dynamodb amazon nosql