Skip to content

Commit 50c2079

Browse files
committed
Added Note
1 parent 74018eb commit 50c2079

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

articles/iot-hub/iot-hub-devguide-routing-query-syntax.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ deviceClient.sendEvent(message, (err, res) => {
145145

146146
### Query expressions
147147

148-
A query on message body needs to be prefixed with the `$body`. You can use a body reference, body array reference, or multiple body references in the query expression. Your query expression can also combine a body reference with message system properties, and message application properties reference. For example, the following are all valid query expressions:
148+
A query on a message body needs to be prefixed with the `$body`. You can use a body reference, body array reference, or multiple body references in the query expression. Your query expression can also combine a body reference with message system properties, and message application properties reference. For example, the following are all valid query expressions:
149149

150150
```sql
151151
$body.Weather.HistoricalData[0].Month = 'Feb'
@@ -163,9 +163,16 @@ length($body.Weather.Location.State) = 2
163163
$body.Weather.Temperature = 50 AND processingPath = 'hot'
164164
```
165165

166-
> [!NOTE]
166+
> [!NOTE]
167+
> To filter a twin notification payload, run your query on the message body:
168+
>
169+
> ```sql
170+
> $body.properties.desired.telemetryConfig.sendFrequency
171+
> ```
172+
173+
> [!NOTE]
167174
> You can run queries and functions only on properties in the body reference. You can't run queries or functions on the entire body reference. For example, the following query is *not* supported and will return `undefined`:
168-
>
175+
>
169176
> ```sql
170177
> $body[0] = 'Feb'
171178
> ```

0 commit comments

Comments
 (0)