本文介绍了在GQL查询中,ANCESTOR是什么:1的意思是?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我遇到包含ANCESTOR IS的GQL查询:1。所以,祖先是什么和什么:1代表什么?
query = db.GqlQuery(SELECT *
FROM my_db
其中一个答案是:1和答案>:3和ch =:4
ORDER BY答案,
my_db_key('name'),
x,
ch)
例如在上面的查询中,这行WHERE ANCESTOR IS :1 AND answer>:3 AND ch =:4是否应该这样做?
解决方案
祖先查询返回的后代给予祖先实体;也就是说,将祖先列为他们的父母或其父母所在的实体等等。
:1
, :2
等等是由以下参数替换为 GqlQuery()
的占位符。
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?
解决方案
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()
.
这篇关于在GQL查询中,ANCESTOR是什么:1的意思是?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!