繁体   English   中英

通过深度嵌套的值过滤DynamoDB扫描

[英]Filtering a DynamoDB scan by deeply nested value

我有一个相当嵌套的对象结构,我想在dynamodb中进行扫描。 看起来像这样:

ProductGroup
| id
| customerId
| serviceId
| [assignedAssets] (An Array of Assets objects, each of which has the following)
| | id
| | sku
| | [instances] (an array of Instance objects, each of which has the following)
| | | id
| | | friendlyName

如果我想找到包含ID为“ instance10”的Instance的ProductGroup,是否可以使用in=运算符的某种组合来利用Dynamo的过滤器表达式? 使用Javascript SDK(如果有任何不同)。

如果您也知道资产ID,则可以使用Maps在服务器端进行过滤,而不必使用数组。

ProductGroup
| id
| customerId
| serviceId
| {assignedAssets} (A Map of Asset objects, where the key is id)
| | id
| | sku
| | {instances} (A Map of Instance objects, where the key is the id)
| | | id
| | | friendlyName

在此,过滤器表达式为attribute_exists(assignedAssets.#assignedAssetId.instances.#instanceId)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM