App Engine数据存储不支持操作员OR [英] App Engine datastore does not support operator OR
问题描述
字符串过滤器=> (field =='value'|| field =='anotherValue');
Query query = pm.newQuery(myType.class,filters);
执行时 - 我回头: App Engine数据存储不支持运算符OR 。
对于这类查询,用户体验最好的方法是什么?
!
执行多个查询。像所有其他数据库一样,数据存储不能有效执行分离。与其他数据库不同,它向用户公开了这个难题,以清楚地表明你所做的并不高效。您唯一的解决方案是执行多个查询 - 每个查询或 - 并将它们合并。
I am trying to query the google datastore for something like (with pm --> persistanceManager):
String filters = "( field == 'value' || field == 'anotherValue' )";
Query query = pm.newQuery(myType.class, filters);
When I execute - I am getting back: App Engine datastore does not support operator OR.
What's the best approach in people experience for this kind of queries?
Any help appreciated!
Perform multiple queries. The Datastore, like all other databases, isn't able to efficiently execute disjunctions. Unlike other databases, it exposes this difficulty to the user, to make it clear that what you're doing isn't efficient. Your only solution is to execute multiple queries - one for each or - and combine them.
这篇关于App Engine数据存储不支持操作员OR的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!