multiple filters vs OR , ndb query
问题 What is the difference between these queries: With consequent filters: qry1 = Account.query() # Retrieve all Account entitites qry2 = qry1.filter(Account.userid >= 40) # Filter on userid >= 40 qry3 = qry2.filter(Account.userid < 50) # Filter on userid < 50 as well Using ndb.OR: qry = Article.query(ndb.OR(Account.userid >= 40, Account.userid < 50)) Using ndb.AND: qry = Article.query(ndb.AND(Account.userid >= 40, Account.userid < 50)) 回答1: The first query does an AND. Thus, only the entities