本文介绍了按 DynamoDB 中列表的内容过滤/查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过列表中包含的地图内容过滤 DynamoDB 查询.这是我正在处理的结构示例.

I am attempting to filter a DynamoDB query by the contents of a Map contained within a List. Here's an example of the structure I'm dealing with.

{
    'EventType': 'git/push'
    'EventTime': 1416251010,
    'Commits': [
        {
            'id': '29d02aff...',
            'subject': 'Add the thing to the place'
        },
        {
            'id': '9d888fec...',
            'subject': 'Spelling errors'
        },
        ...
    ]
}

哈希键是EventType,范围键是EventTime.我正在尝试编写一个过滤器,将查询结果过滤到特定的id.是否可以创建一个 DynamoDB 过滤器表达式来正确过滤这样的查询?(我的第一个想法是使用 contains (a, a),但我认为这不适用于地图列表.)

The hash key is EventType and range key EventTime. I am trying to write a filter that filters the result of a query to a specific id. Is is possible to create a DynamoDB filter expression that correctly filters the query like this? (My first thought was to use contains (a, a), but I don't think that will work on a List of Maps.)

推荐答案

DynamoDB 的 API 表达式语言目前不支持此功能(截至 2014 年 11 月),但提到了一些解决方法 这里.

This isn't currently supported by DynamoDB's API's expression language (as of November 2014) but there are some workarounds mentioned here.

这篇关于按 DynamoDB 中列表的内容过滤/查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-30 14:05