开发者

Making 'OR' Queries in Google App Engine Data Model

开发者 https://www.devze.com 2023-02-18 05:32 出处:网络
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 d

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


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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消