user1132575
user1132575

Reputation: 75

Automatically include ID from datastore in Go

I'm using Go on App Engine. I'm loading struct data from App Engine datastore. Currently I have to get the object ID from the key after the object is loaded from the datastore and then assign it to the object. In App Engine admin panel I can see the key and ID value when I'm using the datastore viewer.

Can I automatically include the key OR the numerical ID as a property from the datastore to the loaded object? (with or without using PropertyLoader interface).

That way I wouldn't have to include it always after the query by parsing it from the given key.

Upvotes: 1

Views: 169

Answers (1)

Rich Churcher
Rich Churcher

Reputation: 7664

I believe the short answer is "no", there's nothing provided in appengine/datastore to have that happen automatically. See this groups topic.

Upvotes: 1

Related Questions