Google App Engine(数据存储) - 将删除的密钥重新生成吗? [英] Google App Engine (datastore) - will a deleted key regenerate?

查看:98
本文介绍了Google App Engine(数据存储) - 将删除的密钥重新生成吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个关于数据存储键的简单问题。如果我删除一个实体,是否有可能再次创建密钥?或每个键是唯一的,只能一次性生成?



谢谢。

解决方案

绝对有可能重新使用密钥。

易于测试,例如使用数据存储管理页面:


  • 创建一个使用自定义/指定键名称和一些属性值的实体模型的实体

  • 删除实体

  • 使用相同键名称和不同的属性值...


    至于具有自动生成ID的键,它是理论上是可能的,但我认为不太可能,因为有很多可能性。从分配标识符


    云数据存储可以配置为使用两个
    不同的自动编号政策



    • 默认策略会生成一个随机大致均匀分布的未使用ID序列。每个ID最多可以有16位b $ b十进制数字。

    • 传统策略创建一系列非连续的较小整数ID。

    • ul>


    I've got a simple question about datastore keys. If I delete an entity, is there any possibility that the key will be created again? or each key is unique and can be generated only one-time?

    Thanks.

    解决方案

    It is definitely possible to re-use keys.

    Easy to test, for example using the datastore admin page:

    • create an entity for one of your entity models using a custom/specified key name and some property values
    • delete the entity
    • create another one using the same key name and different property values...

    As for the keys with auto-generated IDs it is theoretically possible, but I guess rather unlikely due to the high number of possibilities. From Assigning identifiers:

    Cloud Datastore can be configured to generate auto IDs using two different auto id policies:

    • The default policy generates a random sequence of unused IDs that are approximately uniformly distributed. Each ID can be up to 16 decimal digits long.
    • The legacy policy creates a sequence of non-consecutive smaller integer IDs.

    这篇关于Google App Engine(数据存储) - 将删除的密钥重新生成吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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