My NDB model class has repeated property:
class Something(ndb.Model):
tags = ndb.StringProperty(repeated=True)
Is there any way to query for all entities havings tags
equal to ['music', 'cinema']
? I.e. each entity returned should have music
and cinema
tag at the same time and shouldn't have other tags
. The GAE doc says that
You cannot compare repeated properties to list objects (the Datastore won't understand it)
Will I have to fetch all entities with one tag and then filter it manually?
Storing a serialized/hashed version of the list and querying for an exact match against that will likely be more efficient than fetching all of your entities:
Then to query use the same serialization on your search-tags: