Shady Hussein
Shady Hussein

Reputation: 497

Making 'OR' Queries in Google App Engine Data Model

I want to make a query like this "Select name from Person where Address="" OR age="" ". Is that possible in the GAE model. All things include AND closure and not OR. How can i do that with JDO/JPA, Objectify. Thanks in advance

Upvotes: 4

Views: 2630

Answers (2)

Shady Hussein
Shady Hussein

Reputation: 497

I recommend Anyone who is having difficulties with GAE datastore model to have a look at this video. It explains how it works, then you will understand why the limitations exists

http://sites.google.com/site/io/under-the-covers-of-the-google-app-engine-datastore

Upvotes: 0

Riley Lark
Riley Lark

Reputation: 20890

There is no "OR" operation on the datastore. You must do two separate queries and find the intersection in your own code.

http://code.google.com/appengine/docs/python/datastore/gqlreference.html

Upvotes: 5

Related Questions