App Engine数据存储不支持操作员OR [英] App Engine datastore does not support operator OR

查看:128
本文介绍了App Engine数据存储不支持操作员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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆