Reputation: 1023
I want to use look like
datastore.NewQuery("Article").Filter("ID =", id)
to get entity key.
How do this?
Sorry for my poor English. Thanks!
Upvotes: 3
Views: 1576
Reputation: 157
What about these solution, these way you dont need a query, neither an iterator is more direct way of solving the problem.
var article Article
k := datastore.NewKey(c, "Article", "", usrr.User, nil)
q := datastore.Get(c,k,&article)
What did you think?
Upvotes: 11
Reputation: 21835
I never tried Go but I'll give it a shot:
k := datastore.NewKey(c, "Activity", "", id, nil)
q := datastore.NewQuery("Article").Filter("__key__ =", k)
Where c
is your appengine.Context
Upvotes: 2