In the attempt of migrating to the new Datastore mode in Firestore from the former Datastore, and as well migrating from Python 2.7 to 3.7, we're trying to figure out how to query using OR operator!
Formally using the NDB library, there was ndb.AND
& ndb.OR
yet there is no mentioning of the OR in the new query structure in Python 3
According to the docs, query happens on a few steps, and it is possible to add multiple filters on multiples add_filter
steps:
query = client.query(kind='Task')
query.add_filter('done', '=', False)
query.add_filter('priority', '=', 4)
The above basically means:
Task entities that are marked not done AND have a priority of 4
How about the OR operator?
What if one wants to query for a property that has this value OR this value?