0

I have the datastore as follows,

class Data(db.Model):
     project = db.StringProperty()
     project_languages = db.ListProperty(str,default=[])

When user inputs a language (input_language), I want to output all the projects which contains the language user mentioned in it's language list (project_languages).

I tried to do it in the below way but got an error saying,

BadQueryError: Parse Error: Invalid WHERE Condition

db.GqlQuery("SELECT * FROM Data WHERE input_language IN project_languages")

What should be my query, if I want to get the data in the above mentioned way?

Wasim Thabraze
  • 780
  • 1
  • 12
  • 29

1 Answers1

1

Not sure if you are using python for the job.. If so I highly recommend you use the ndb library for datastore queries. The solution is easy as Data.query(A.IN(B))

drtf
  • 1,886
  • 2
  • 21
  • 19