Skip to content

Commit fd149c9

Browse files
Merge pull request #297225 from DENKEN02MSFT/IoTFreshness_Row13
IoT Freshness - row 13
2 parents 901e858 + 47e8427 commit fd149c9

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

articles/iot-hub/iot-hub-devguide-query-language.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ author: SoniaLopezBravo
55

66
ms.service: azure-iot-hub
77
ms.topic: concept-article
8-
ms.date: 09/29/2022
8+
ms.date: 03/28/2025
99
ms.author: sonialopez
1010
ms.custom: devx-track-csharp
1111
---
@@ -15,9 +15,9 @@ ms.custom: devx-track-csharp
1515
IoT Hub provides a powerful SQL-like language to retrieve information regarding [device twins](iot-hub-devguide-device-twins.md), [module twins](iot-hub-devguide-module-twins.md), [jobs](iot-hub-devguide-jobs.md), and [message routing](iot-hub-devguide-messages-d2c.md). This article presents:
1616

1717
* An introduction to the major features of the IoT Hub query language, and
18-
* The detailed description of the language. For details on query language for message routing, see [queries in message routing](../iot-hub/iot-hub-devguide-routing-query-syntax.md).
18+
* The detailed description of the language. For more information about query language for message routing, see [IoT Hub message routing query syntax](../iot-hub/iot-hub-devguide-routing-query-syntax.md).
1919

20-
For specific examples, see [Queries for device and module twins](query-twins.md) or [Queries for jobs](query-jobs.md).
20+
For specific examples, see [Queries for IoT Hub device and module twins](query-twins.md) or [Queries for IoT Hub jobs](query-jobs.md).
2121

2222
[!INCLUDE [iot-hub-basic](../../includes/iot-hub-basic-partial.md)]
2323

@@ -33,7 +33,7 @@ You also can run queries within your applications using the Azure IoT service SD
3333

3434
For example code implementing IoT Hub queries, see the [Query examples with the service SDKs](#query-examples-with-the-service-sdks) section.
3535

36-
For links to SDK reference pages and samples, see [Azure IoT SDKs](iot-hub-devguide-sdks.md).
36+
For links to SDK reference pages and samples, see [Azure IoT Hub SDKs](iot-hub-devguide-sdks.md).
3737

3838
## Basics of an IoT Hub query
3939

@@ -130,7 +130,7 @@ For example:
130130
WHERE devices.jobs.deviceId = 'myDeviceId'
131131
```
132132

133-
The allowed conditions are described in the [expressions and conditions](#expressions-and-conditions) section.
133+
The allowed conditions are described in the [Expressions and conditions](#expressions-and-conditions) section.
134134

135135
### GROUP BY clause
136136

@@ -150,7 +150,7 @@ For example:
150150
Currently, the GROUP BY clause is only supported when querying device twins.
151151

152152
> [!CAUTION]
153-
> The term `group` is currently treated as a special keyword in queries. In case, you use `group` as your property name, consider surrounding it with double brackets to avoid errors, e.g., `SELECT * FROM devices WHERE tags.[[group]].name = 'some_value'`.
153+
> The term `group` is currently treated as a special keyword in queries. In case, you use `group` as your property name, consider surrounding it with double brackets to avoid errors, as shown in this example: `SELECT * FROM devices WHERE tags.[[group]].name = 'some_value'`.
154154
155155
The formal syntax for GROUP BY is:
156156

@@ -165,7 +165,7 @@ GROUP BY <group_by_element>
165165

166166
### Query results pagination
167167

168-
A query object is instantiated with a max page size of **less than** or **equal to** 100 records. To obtain multiple pages, call the [nextAsTwin](device-twins-node.md#create-a-service-app-that-updates-desired-properties-and-queries-twins) on Node.js SDK or [GetNextAsTwinAsync](device-twins-dotnet.md#create-a-service-app-that-updates-desired-properties-and-queries-twins) on .Net SDK method multiple times.
168+
A query object is instantiated with a max page size of **less than** or **equal to** 100 records. To obtain multiple pages, call the [nextAsTwin](how-to-device-twins.md?pivots=programming-language-node#create-a-device-twin-query) on Node.js SDK or [GetNextAsTwinAsync](how-to-device-twins.md?pivots=programming-language-csharp#create-a-device-twin-query) on .NET SDK method multiple times.
169169
A query object can expose multiple Next values, depending on the deserialization option required by the query. For example, a query object can return device twin or job objects, or plain JSON when using projections.
170170

171171
## Expressions and conditions
@@ -232,7 +232,7 @@ When querying twins and jobs the only supported function is:
232232

233233
| Function | Description |
234234
| -------- | ----------- |
235-
| IS_DEFINED(property) | Returns a Boolean indicating if the property has been assigned a value (including `null`). |
235+
| IS_DEFINED(property) | Returns a Boolean indicating if the property is assigned a value (including `null`). |
236236

237237
In routes conditions, the following math functions are supported:
238238

@@ -254,7 +254,7 @@ In routes conditions, the following type checking and casting functions are supp
254254
| AS_NUMBER | Converts the input string to a number. `noop` if input is a number; `Undefined` if string doesn't represent a number.|
255255
| IS_ARRAY | Returns a Boolean value indicating if the type of the specified expression is an array. |
256256
| IS_BOOL | Returns a Boolean value indicating if the type of the specified expression is a Boolean. |
257-
| IS_DEFINED | Returns a Boolean indicating if the property has been assigned a value. This function is supported only when the value is a primitive type. Primitive types include string, Boolean, numeric, or `null`. DateTime, object types and arrays aren't supported. |
257+
| IS_DEFINED | Returns a Boolean indicating if the property is a value. This function is supported only when the value is a primitive type. Primitive types include string, Boolean, numeric, or `null`. DateTime, object types, and arrays aren't supported. |
258258
| IS_NULL | Returns a Boolean value indicating if the type of the specified expression is null. |
259259
| IS_NUMBER | Returns a Boolean value indicating if the type of the specified expression is a number. |
260260
| IS_OBJECT | Returns a Boolean value indicating if the type of the specified expression is a JSON object. |
@@ -279,7 +279,7 @@ In routes conditions, the following string functions are supported:
279279

280280
### C# example
281281

282-
The query functionality is exposed by the [C# service SDK](iot-hub-devguide-sdks.md) in the **RegistryManager** class.
282+
The query functionality is exposed by the [Azure IoT Hub service SDK for .NET](iot-hub-devguide-sdks.md#azure-iot-hub-service-sdks) in the **RegistryManager** class.
283283

284284
Here's an example of a simple query:
285285

@@ -295,11 +295,11 @@ while (query.HasMoreResults)
295295
}
296296
```
297297

298-
The query object is instantiated with the parameters mentioned in the [query results pagination](#query-results-pagination) section. Multiple pages are retrieved by calling the **GetNextAsTwinAsync** methods multiple times.
298+
The query object is instantiated with the parameters mentioned in the [Query results pagination](#query-results-pagination) section. Multiple pages are retrieved by calling the **GetNextAsTwinAsync** methods multiple times.
299299

300300
### Node.js example
301301

302-
The query functionality is exposed by the [Azure IoT service SDK for Node.js](iot-hub-devguide-sdks.md) in the **Registry** object.
302+
The query functionality is exposed by the [Azure IoT Hub service SDK for Node.js](iot-hub-devguide-sdks.md#azure-iot-hub-service-sdks) in the **Registry** object.
303303

304304
Here's an example of a simple query:
305305

@@ -322,11 +322,11 @@ var onResults = function(err, results) {
322322
query.nextAsTwin(onResults);
323323
```
324324

325-
The query object is instantiated with the parameters mentioned in the [query results pagination](#query-results-pagination) section. Multiple pages are retrieved by calling the **nextAsTwin** method multiple times.
325+
The query object is instantiated with the parameters mentioned in the [Query results pagination](#query-results-pagination) section. Multiple pages are retrieved by calling the **nextAsTwin** method multiple times.
326326

327327
## Next steps
328328

329329
* Learn about routing messages based on message properties or message body with the [IoT Hub message routing query syntax](iot-hub-devguide-routing-query-syntax.md).
330-
* Get specific examples of [Queries for device and module twins](query-twins.md) or [Queries for jobs](query-jobs.md).
330+
* Get specific examples of [Queries for IoT Hub device and module twins](query-twins.md) or [Queries for IoT Hub jobs](query-jobs.md).
331331

332332

0 commit comments

Comments
 (0)