简体   繁体   English

DynamoDB中PrimaryKey的索引名称是什么

[英]What is the index name of the PrimaryKey in DynamoDB

I have a quick question. 我有一个快速的问题。 In my code I am using the IndexName parameter to query my respective indexes. 在我的代码中,我使用IndexName参数来查询我的相应索引。 This lets my code look like the following: IndexName: config.myIndexName which is a style I really like. 这让我的代码如下所示: IndexName: config.myIndexName这是我真正喜欢的样式。 However when using the Primary Key, it looks like you need to leave off the IndexName entirely. 但是,在使用主键时,您似乎需要完全取消IndexName。 I don't like this as I feel it makes my query style less consistent and harder to read. 我不喜欢这个,因为我觉得它使我的查询风格不那么一致,难以阅读。

Does anyone know the "name" of the primary key index, so that I can specify the primary key index using IndexName? 有没有人知道主 索引的“名称”,以便我可以使用IndexName指定主 索引?

The indexName parameter must be left blank when referring to the Primary Key in the Query API. 在引用查询API中的主键时, indexName参数必须保留为空。

The Primary Key is not considered an Index. 主键不被视为索引。 You can verify this by clicking over to the Indexes tab of your table and seeing that there are no indexes listed. 您可以通过单击表的“索引”选项卡并查看没有列出索引来验证这一点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM