我在发电机中有一个键,它有两个具有不同范围键的全局二级索引。像这样:
const productSchema = new Schema(
{
productCategory: {
type: String,
index: [{
global: true,
rangeKey: 'serialNumberEnd',
name: 'productCategory',
throughput: { read: 1, write: 1 },
project: ['quantity'],
},
{
global: true,
rangeKey: 'orderType',
name: 'openOrders',
throughput: { read: 1, write: 1 },
project: true,
}],
},
{
throughput: { read: 1, write: 1 },
useNativeBooleans: true,
saveUnknown: true,
},
);`
尝试使用“名称”似乎不是答案。
Resource.query('openOrder').eq(id)
在构建查询时,我应该如何区分资源中同一 Key 上的两个 GSI?
编辑 - 向架构添加了额外的上下文,将答案移到了答案部分