fiware - Query entities by the logical operator OR with Fiware Orion
问题描述
I dont be able to retrieve entities form Orion querys with 2 conditions by the logical operator OR.
For example, if I want to retrieve the entities that have temperature > 20 OR humidity enter code here< 50.
But I only can retrieve the query by the logical operator AND:
http:// localhost:1026/v2/entities?q=temperature>20;humidity<50
Also I try with | to separate the conditions, like this:
http:// localhost:1026/v2/entities?q=temperature>20|humidity<50
But gived me the next error:
{
"error": "BadRequest",
"description": "forbidden characters in String Filter"
}
How I could to retrieve queries to Orion by te logical operator OR?
解决方案
正确的是逗号分隔的q StringFilter项目是 ANDed 在一起。据我记得,我们从未为 StringFilters 实现任何 OR。
为了实现你想要的,我建议做两个查询并合并结果。对不起 ...
规格在这里。它清楚地说:
简单查询语言提供了一种简化的语法来检索与一组条件匹配的实体。查询由以“;”分隔的语句列表组成 特点。每个语句都表示一个匹配条件。查询返回匹配所有匹配条件(AND 逻辑运算符)的所有实体。
推荐阅读
- java - 比较2个整数并检查数字是否相同
- ios - 在工作表消失后将数据写入 UserDefaults 时崩溃 (SIGABRT)
- sql - 缩短输出时,带有查询功能的 Google 表格中的问题会留下幽灵副本
- api - 在我向它发送资金后,ETH 没有出现在我的主网上节点上
- python - 返回一个数组,其中包含所有 predict_prices 和实际价格之间的平方误差(来自数据集)
- python - 错误地我会给aws ubuntu服务器中的主目录777权限
- windows - 在 Windows 10 20H2 上,管理员无法在 sysprep 后管理 Windows Defender
- file - 当我在内核中 cd 进入文件夹时,有没有办法在文件夹中执行文件/文件夹。我正在使用基于 Unix 的系统(Arch、Manjaro、MacOSX 等)
- r - 将函数参数传递到 mutate 语句的左侧
- arduino - 将草图上传到 arduino uno/esp8266 时出现问题