Entity identifiers
Every entity in Datastore is assigned a unique identifier when created, similar to primary keys of a relational database. Identifiers are unique for the entity's namespace and kind, and may take one of two forms: a string name or a numerical ID.
Names are generally preferred when entities already contain a unique property that may be used to perform lookups. For example, a user's account entity may use the username as the entity's name. This ensures that the username is unique, and provides a very easy method for retrieving the user's account data.
If no name is specified, Datastore will automatically generate a randomly distributed numerical ID for the entity. In cases where a numerical ID needs to be known ahead of time, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access