Making 'OR' Queries in Google App Engine D

2019-03-30 06:33发布

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

2条回答
\"骚年 ilove
2楼-- · 2019-03-30 06:50

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

查看更多
Fickle 薄情
3楼-- · 2019-03-30 06:52

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

查看更多
登录 后发表回答