How to use IN clause in iot hub route query

旧城冷巷雨未停 提交于 2019-12-13 02:43:50

问题


The following query is not working in route query: $body.Weather.Temperature in ['30','50']

I checked the documentation and the syntax looks right.


回答1:


IN and NIN (not in) operator it used to check the item is or isn't in the array constants like ['wired', 'wifi'].

For your case, you need use Comparison operator: >= and <= like this:

$body.Weather.Temperature >= 30 AND $body.Weather.Temperature <= 50

For detailed information you can reference "IoT Hub query language for device twins, jobs, and message routing".

Update:

For selecting the exact value 30/50 you can use the following query string as a workaround.

$body.Weather.Temperature = 30 OR $body.Weather.Temperature = 50



来源:https://stackoverflow.com/questions/49692936/how-to-use-in-clause-in-iot-hub-route-query

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!