1
votes

I have my entity in Cloud datastore. One of the properties is Localities, which is concatenated string, eg. Los Angeles; San Francisco; Las Vegas. Now how do I get data which the below like query will give:

Select * from CloudEntity where Localities like "%San Francisco%"

1

1 Answers

4
votes

Instead of storing a single string, store a list of strings. Then use an equality filter. In json it would be:

Localities:  {listValue: [
    {stringValue: "Los Angeles"}, 
    {stringValue: "San Francisco"}, 
    {stringValue: "Las Vegas"}]}

then:

Select * from CloudEntity where Localities = "San Francisco"