我正在使用 electrodb 从 dynamodb 获取数据。
我试图在不知道 pk 值(品牌)且只知道 sk 值(类型)的情况下获取数据 举例来说,获取所有 type = type 的汽车。
有可能因为我不知道怎么做吗?
这是我的实体索引:
indexes: {
byCar: {
pk: {
field: PK,
composite: ['brand'],
template: '${brand}',
},
sk: {
field: SK,
composite: ['type'],
template: '${type}',
},
},
},
},
我从未听说过 ElectroDB,但根据您链接的文档,语法应如下所示:
await StoreLocations.query
.byCar({
brand: "someBrand"
})
.go();