App Engine Go中的无情查询 [英] Kindless Queries in App Engine Go
问题描述
在Python中,它是
q = db.Query()
q.ancestor(ancestor_key)
我试过了:
q.Ancestor(ancestor_key)
<
我也试过: p> q:=& datastore.Query {}
q.Ancestor(ancestor_key)
我得到错误datastore:空查询类型
感谢您提供任何有关此事的帮助。
Rich Churcher的评论似乎是正确的,至少在这个时候是这样。
我认为Go中不支持Python无用的祖先查询。
一段时间以来,我认为你可以使用祖先密钥的Kind()
方法,然后我喝了一些咖啡,然后来到我的感觉。
In Python it's
q = db.Query()
q.ancestor(ancestor_key)
I tried:
q := datastore.NewQuery("")
q.Ancestor(ancestor_key)
I get the error "datastore: empty kind" when running GetAll
I also tried:
q := &datastore.Query{}
q.Ancestor(ancestor_key)
I get the error "datastore: empty query kind"
Thanks in advance for any help with this matter.
Rich Churcher's comment seems to be right, at least at this point in time.
I don't think the Python kindless ancestor query is supported in Go. For a moment there I thought you could use the ancestor key's Kind() method, then I had some more coffee and came to my senses.
这篇关于App Engine Go中的无情查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!