[英]FIWARE Orion string query and dates
I have a question regarding queries, I am working on FIWARE Orion instance where the date is stored as a string: 我有一个关于查询的问题,我正在将日期存储为字符串的FIWARE Orion实例上工作:
"date": {
"type": "String",
"value": "2019-01-02T00:00:00.0000Z",
"metadata": {}
}
I have checked documentation about queries (most interest in <
>
) 我检查了有关查询的文档(对<
>
最感兴趣)
This operation is only valid for target properties of type date, number or string (used with target properties of other types may lead to unpredictable results). 此操作仅对日期,数字或字符串类型的目标属性有效(与其他类型的目标属性一起使用可能会导致不可预测的结果)。
But it is not possible for me to for example to use this query: 但是我无法例如使用以下查询:
q=date<2020-04-13T00:00:00.0000Z
q=date<2020-04-13
My question is this possible if it is then what I am doing wrong here. 我的问题是,如果那是我在这里做错了,那是可能的。 If not then I will have to find an alternative way of getting this query to work. 如果没有,那么我将不得不寻找一种替代方法来使该查询正常工作。
Thanks. 谢谢。
I think the DateTime
special attribute type (see "Special Attribute Types" at NGSIv2 specification ) is the one you need. 我认为DateTime
特殊属性类型(请参阅NGSIv2规范中的 “特殊属性类型”)是您需要的一种。
You can see additional information and examples in this presentation slides 64 and 65. 您可以在此演示文稿幻灯片64和65中查看其他信息和示例。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.