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()
.
精彩评论