在DynamoDB中按列表内容进行过滤/查询 [英] Filtering / Querying by the Contents of a List in DynamoDB

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

问题描述

我正在尝试通过List中包含的Map的内容过滤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过滤器表达式来像这样正确过滤查询? (我首先想到的是使用包含(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中按列表内容进行过滤/查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆