In a GQL query what ANCESTOR IS :1 exactly means?

大城市里の小女人 提交于 2020-01-06 08:48:33

问题


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?


回答1:


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 to GqlQuery().



来源:https://stackoverflow.com/questions/7273215/in-a-gql-query-what-ancestor-is-1-exactly-means

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!