DynamoDB创建索引地图或列表类型 [英] DynamoDB create index on map or list type

查看:501
本文介绍了DynamoDB创建索引地图或列表类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要一个索引添加到属性,DynamoDB地图对象的内部,似乎无法找到一个方法来做到这一点。这是不是就是支持或索引确实只允许对标量值?解决这个问题的文件似乎是相当稀疏。我希望索引功能类似于MongoDB中,但迄今的方法我已经采取了使用点语法引用属性,索引一直没有成功。任何帮助或其他信息,可以提供的AP preciated。

I'm trying to add an index to an attribute inside of a map object in DynamoDB and can't seem to find a way to do so. Is this something that is supported or are indexes really only allowed on scalar values? The documentation around this seems to be quite sparse. I'm hoping that the indexing functionality is similar to MongoDB but so far the approaches I've taken of referencing the attribute to index using dot syntax has not been successful. Any help or additional info that can be provided is appreciated.

推荐答案

索引只能在顶级JSON内置属性。另外,范围键必须在DynamoDB(字符串,数字,二进制中的一个,或布尔)标值。

Indexes can be built only on top-level JSON attributes. In addition, range keys must be scalar values in DynamoDB (one of String, Number, Binary, or Boolean).

http://aws.amazon.com/dynamodb/faqs/

问:在查询中DynamoDB JSON数据有什么不同

Q: Is querying JSON data in DynamoDB any different?

没有。您可以创建一个全局二级索引或任何顶级JSON元素本地二级索引。例如,假设你存储包含关于一个人以下信息的JSON文件:姓,名,邮编code,和他们所有的朋友列表。姓,名和Zip code将是顶级的JSON元素。你可以创建一个索引,让您查询的基础上名字,姓氏或Zip code。好友列表是不是一个顶级元素,因此,你不能索引的好友列表。有关全球二级索引及其查询功能的更多信息,请参见本FAQ中的辅助索引部分。

No. You can create a Global Secondary Index or Local Secondary Index on any top-level JSON element. For example, suppose you stored a JSON document that contained the following information about a person: First Name, Last Name, Zip Code, and a list of all of their friends. First Name, Last Name and Zip code would be top-level JSON elements. You could create an index to let you query based on First Name, Last Name, or Zip Code. The list of friends is not a top-level element, therefore you cannot index the list of friends. For more information on Global Secondary Indexing and its query capabilities, see the Secondary Indexes section in this FAQ.

问:什么类型的数据可以被索引

Q: What data types can be indexed?

所有标量数据类型(数字,字符串,二进制和布尔),可用于本地二级索引键的范围关键因素。集,列表和地图类型不能被索引。

All scalar data types (Number, String, Binary, and Boolean) can be used for the range key element of the local secondary index key. Set, list, and map types cannot be indexed.

这篇关于DynamoDB创建索引地图或列表类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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