DynamoDB 嵌套查询支持 [英] DynamoDB nested query support

查看:29
本文介绍了DynamoDB 嵌套查询支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Amazon DynamoDB 扫描操作是否允许您查询 ArrayObject 类型的嵌套属性?例如,

Do Amazon DynamoDB scan operation allow you to query on nested attributes of type Array or Object? For example,

{
    Id: 206,
    Title: "20-Bicycle 206",
    Description: "206 description",
    RelatedItems: [
        341, 
        472, 
        649
    ],
    Pictures: {
        FrontView: "123", 
        RearView: "456",
        SideView: "789"
    }
}

我可以查询 RelatedItems[2]Pictures.RearView 属性吗?

Can I query on RelatedItems[2] or Pictures.RearView attributes?

推荐答案

是的,您可以使用 过滤表达式,和条件表达式一样.讨论函数的部分您可以在这些类型的表达式中使用的内容提到以下内容:

Yes, you can use a Filter Expression, which is just like Condition Expression. The section that talks about the functions that you can use in these types of expressions mentions the following:

对于嵌套属性,您必须提供其完整路径;有关更多信息,请参阅 文档路径."

"For a nested attribute, you must provide its full path; for more information, see Document Paths."

文档路径 参考有示例关于如何在 DynamoDB 数据类型 比如 List(你称之为数组)和 Map(你称之为对象).查看该参考以获取有关如何执行此操作的示例:

The Document Paths reference has examples on how to reference nested attributes in DynamoDB data types like List (what you are calling an array) and Map (what you are calling an object). Check out that reference for examples on how to do so:

  • 我的列表[0]
  • 另一个列表[12]
  • 这个列表[5][11]
  • MyMap.nestedField
  • MyMap.nestedField.deeplyNestedField

这篇关于DynamoDB 嵌套查询支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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