A
is ancestor of B
type A struct {}
type B struct {}
How would I search for B
whose string ID is stringID
, regardless of ancestor? (B and ancestor A may not even exist)
ctx := appengine.NewContext(r)
a := ??? // 'A' may not exist, so what do I do here?
k := datastore.NewKey(ctx, "B", "stringID", 0, a)
e := new(B)
if err := datastore.Get(ctx, k, e); err != nil {
http.Error(w, err.Error(), 500)
return
}