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

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

问题描述

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

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 属性?

推荐答案

是的,您可以使用过滤器表达式,类似于条件表达式。讨论函数的部分您可以在这些类型的表达式中使用的内容提及以下内容:

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(您要调用的数组),并且地图(您正在调用的对象)。查阅该参考资料以获取有关操作方法的示例:

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:


  • MyList [0]

  • AnotherList [12]

  • ThisList [5] [11]

  • MyMap.nestedField

  • MyMap.nestedField。 deepNestedField

  • MyList[0]
  • AnotherList[12]
  • ThisList[5][11]
  • MyMap.nestedField
  • MyMap.nestedField.deeplyNestedField

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

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