在 GQL 查询中 ANCESTOR IS :1 到底意味着什么?
我遇到过包含 ANCESTOR IS :1 的 GQL 查询。那么,祖先是什么? :1 代表什么?
query = db.GqlQuery("SELECT * "
"FROM my_db "
"WHERE ANCESTOR IS :1 AND answer > :3 AND ch = :4 "
"ORDER BY answer",
my_db_key('name'),
x,
ch)
例如,在上面的查询中,这行“WHERE ANCESTOR IS :1 AND answer > :3 AND ch = :4 ”应该做什么?
I have come across with GQL queries containing ANCESTOR IS :1. So, what the ancestor is and what :1 stands for?
query = db.GqlQuery("SELECT * "
"FROM my_db "
"WHERE ANCESTOR IS :1 AND answer > :3 AND ch = :4 "
"ORDER BY answer",
my_db_key('name'),
x,
ch)
e.g in the query above what this line "WHERE ANCESTOR IS :1 AND answer > :3 AND ch = :4 " is suppose to do?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
祖先查询返回给定祖先实体的后代;也就是说,将祖先列为其父级的实体,或其父级,等等。
:1
、:2
等是占位符,由以下参数替换到GqlQuery()
。An ancestor query returns descendants of the given ancestor entity; that is, entities that list the ancestor as their parent, or whose parent does, etc.
:1
,:2
, etc. are placeholders that are replaced by the following parameters toGqlQuery()
.