有没有办法分配 "deallocate" id?

Is there a way to "deallocate" id's that were allocated?

假设我已经使用 allocateIdRange 方法分配了一个 ID 块。有没有办法撤消这个?我很担心在没有办法撤消的情况下分配大块 ID,并且 potentially/accidentally 分配大范围的 ID,这些 ID 将永远无法再次分配。

我个人没有尝试过,但我认为您可以删除想要 'deallocate' 的键。就像你一般删除一个实体一样。

简答:不,使用allocateIdRange方法后无法deallocate ID。

长答案: 在用这种方法进行了大量测试后,我认为不可能“解除分配”那些 ID。甚至查看 App Engine 的 docs for Datastore or the docs API 以了解任何可能的方法。

既然你担心分配很多然后不能再次分配它们,因为那些已经被保留,我只想说小心是最好的选择,因为没有 built-in 方法在 deallocate.

的库中