This question as already been answered for Python: How to get all records from GAE datastore with particular parent?
How do I do it in Go? I would like to do something like:
t := new(TagRecord)
k, err := datastore.DecodeKey(r.URL.Path[1:])
...
_, err = datastore.NewQuery("TagRecord").
Filter("Parent =", k).
Order("-CreatedAt").
Limit(1).
Run(c).Next(t)
...but this fails miserably with the following error:
datastore: query has no more results
When I try filtering by other properties, including those hard coded into the filter and those passed through the URL, the query runs properly and populates t with the proper properties. With what humiliating simplicity can my problem be fixed?