gpt4 book ai didi

node.js - 如何批量获取DynamoDB中的索引表?

转载 作者:行者123 更新时间:2023-12-02 10:09:27 25 4
gpt4 key购买 nike

如何在DynamoDB中批量获取全局二级索引?

<小时/>

这些参数给了我一个架构错误,因为这个哈希键仅在索引表中,主要有其他。

  const params = {
RequestItems: {
"MyTableName": {
Keys: [
{
"ThisHashKeyIsOnlyInIndexTable": value
}
]
}
}
};

docClient.batchGet(params, (err, data) => {
// ...
}

文档甚至没有提到如何仅从索引中批量获取。

最佳答案

不幸的是,GetItemBatchGetItem 无法访问任何索引。您无法像查询 API 那样在参数上传递 IndexName

突出显示与问题相关的要点。

ReturnConsumedCapacity — (String) Determines the level of detail about provisioned throughput consumption that is returned in the response:

INDEXES - The response includes the aggregate ConsumedCapacity for the operation, together with ConsumedCapacity for each table and secondary index that was accessed. Note that some operations, such as GetItem and BatchGetItem, do not access any indexes at all. In these cases, specifying INDEXES will only return ConsumedCapacity information for table(s).

TOTAL - The response includes only the aggregate ConsumedCapacity for the operation. NONE - No ConsumedCapacity details are included in the response.

关于node.js - 如何批量获取DynamoDB中的索引表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42501001/

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