There’s really not that much documentation on how to write some Go
code to work properly with Google Datastore or how to structure
it the right way.
Yes, there are some resources, but they really aren’t that great:
Building your typical model
This part is pretty basic, we’re just gonna create a new file where you’ll be
interacting with a data structure.
It’s important to understand what’s going on here.
datastore:"-" tells the datastore module not to save this field
into the database.
json:"id" renames and maps it to that name when outputting or reading
a JSON structure.
In datastore, everything is referenced by Keys and not by your Id field. In
order to update a model or create a new one, you need to generate the key
onto your model’s instance.
Get By Id
Get By Ids
Since there really isn’t a “Id IN” ability in datastore, we have to
do it through an alternative method. More info on Stack Overflow.