开发者

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

开发者 https://www.devze.com 2023-04-01 17:00 出处:网络
I have come across with GQL queries containing ANCESTOR IS :1. So, what the ancestor is and what :1 stands for?

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 m开发者_运维问答y_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?


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

0

精彩评论

暂无评论...
验证码 换一张
取 消