user3062352
user3062352

Reputation: 1

Gql query returning unexpected empty

I'm trying to use a query i know is supposed to return a value but it does'nt and i'm unable to filter using Type

heres the query:

SELECT Type FROM machinetype WHERE Brand = 'Avant'

heres the index serving:

Type ▲ , Brand ▲

Upvotes: 0

Views: 236

Answers (1)

loki
loki

Reputation: 2311

There are no results returned because you are missing to fetch them.

Python:

q = db.GqlQuery("""SELECT Type FROM machinetype WHERE Brand = 'Avant'""")
results = q.fetch(10)

or for one result

results = q.get()

Another possibility is that you modelled Brand as Text which makes it non-indexable or you have the code running in production and did never run the query on the development server and the index was not created.

Upvotes: 1

Related Questions