![](/img/trans.png)
[英]“onlyChangedAttrs” boolean flag in Fiware Draco Subscription not working
[英]Using expression in Fiware Draco Subscription
我們希望根據“設備時間”屬性過濾發送給 Draco 的通知。 只有當該屬性不為空時,我們才想向 Draco 發送數據。 我們如何在 Draco 訂閱中實現這一點。 我在表達上嘗試了很多組合,但沒有任何效果。 你能在這里幫忙嗎:
curl -iX POST \
'http://52.172.34.29:1026/v2/subscriptions?options=skipInitialNotification' \
-H 'Content-Type: application/json' \
-H 'fiware-service: openiot' \
-H 'fiware-servicepath: /' \
-d '{
"description": "Subscription",
"subject": {
"entities": [
{
"idPattern": ".*"
}
],
"condition": {
"attrs": [],
"expression":{"q":"devicetime==.*"}
}
},
"notification": {
"http": {
"url": "http://52.172.34.29:3003/v2/notify"
},
"attrs": [],
"onlyChangedAttrs":true,
"throttling": 5
}
}'
根據 NGSIv2 規范:一元否定語句使用一元運算符,。 而肯定的一元語句根本不使用運算符。 一元語句用於檢查目標屬性是否存在。 例如, temperature
匹配具有稱為“溫度”屬性的實體(無論其值如何),而!temperature
匹配不具有稱為“溫度”的屬性的實體。
所以你應該用
"expression":{"q":"devicetime"}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.