简体   繁体   English

数据存储查看器中的实体密钥是什么?

[英]What is the Entity Key for in the Datastore Viewer?

I am new to Google App Engine, Python and NoSQL. 我是Google App Engine,Python和NoSQL的新手。

While browsing the Datastore Viewer I noticed that there is a key labelled "Key" in the list view, and "Entity Key" in the single entity edit view, which is generated automatically. 在浏览数据存储查看器时,我注意到列表视图中有一个标记为“ Key”的键,而单个实体编辑视图中有一个“ Entity Key”,它是自动生成的。

What is it for? 这是为了什么 Should I use this to identify my entities? 我应该使用它来识别我的实体吗? Or should I just ignore it? 还是我应该忽略它? Is it an internal key used by App Engine? 它是App Engine使用的内部密钥吗?

Any light shed on this would be much appreciated! 对此,我们将不胜感激!

Thanks 谢谢

UPDATE: 更新:

Here is a screenshot of what is confusing me: http://snag.gy/J7ISd.jpg 这是令我困惑的屏幕截图: http : //snag.gy/J7ISd.jpg

From left to right in the table there is "Key" (the one that I am asking about), "Write Ops", "ID", "Key Name". 表中从左到右分别是“密钥”(我要问的那个),“写操作”,“ ID”,“密钥名称”。 My question is, what is "Key" used for? 我的问题是,“密钥”的作用是什么?

UPDATE 2: 更新2:

Tim Hoffman answered my question in the comment. 蒂姆·霍夫曼(Tim Hoffman)在评论中回答了我的问题。 The "Key" column is the url safe version of the whole key. “密钥”列是整个密钥的网址安全版本。

So to sum up, the key of an entity is composed of either a numeric ID or a string key, AND each entity also has a url safe version that can be passed around the URLs, that is automatically generated. 综上所述,实体的密钥由数字ID或字符串密钥组成,并且每个实体还具有可以在URL周围传递的URL安全版本,该版本是自动生成的。

Datastore entities are represented by their unique key . 数据存储区实体由其唯一键表示 As the docs state, each entity in the Datastore has a key that uniquely identifies it. 如文档所述,数据存储区中的每个实体都有一个唯一标识它的密钥。 The key consists of the following components: 密钥包含以下组件:

  • The kind of the entity, which categorizes it for the purpose of Datastore queries 实体的类型,出于数据存储区查询的目的对其进行分类
  • An identifier for the individual entity, which can be either a key name string an integer numeric ID 各个实体的标识符,可以是键名字符串或整数ID
  • An optional ancestor path locating the entity within the Datastore hierarchy 可选的祖先路径,用于在数据存储层次结构中定位实体

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

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