google-app-enginegoogle-cloud-datastoregqlgqlquery

GQL query with multiple condition on one List field


I want to get object, which listfield contains 'foo', 'bar' and 'foobar' strings. Can I do query like this

SELECT * FROM Entity WHERE listfield = 'foo' AND listfield = 'bar' AND listfiled = 'foobar'

where listfield = StringListProperty() ?


Solution

  • One thing to note, make sure that your index.yaml file contains all the index permutations you require. Your query as above would have an index like this: