gpt4 book ai didi

amazon-web-services - 通过 updateTable 创建多个 GSI - DynamoDB

转载 作者:行者123 更新时间:2023-12-04 23:48:34 24 4
gpt4 key购买 nike

我正在使用 updateTable在 DynmaoDB 中,根据文档,如果我们要创建多个全局二级索引 (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"
}
}
}]
}

我是否以错误的格式传递参数?

最佳答案

来自 DynamoDB documentation :

You can only create or delete one global secondary index per UpdateTable operation. However, if you run multiple UpdateTable operations simultaneously, you can create multiple indexes at a time. You can run up to five of these UpdateTable operations on a table at once, and each operation can create exactly one index.

关于amazon-web-services - 通过 updateTable 创建多个 GSI - DynamoDB,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28402003/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com