Skip to content

Commit b59e07f

Browse files
committed
updated property size example, module twin topic, and rolled date
1 parent 1f0fc07 commit b59e07f

File tree

2 files changed

+40
-12
lines changed

2 files changed

+40
-12
lines changed

articles/iot-hub/iot-hub-devguide-device-twins.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ms.author: wesmc
77
ms.service: iot-hub
88
services: iot-hub
99
ms.topic: conceptual
10-
ms.date: 06/10/2019
10+
ms.date: 02/01/2020
1111
---
1212

1313
# Understand and use device twins in IoT Hub
@@ -246,7 +246,7 @@ Tags, desired properties, and reported properties are JSON objects with the foll
246246

247247
* Integers can have a minimum value of -4503599627370496 and a maximum value of 4503599627370495.
248248

249-
* Strings are UTF-8 encoded and can have a maximum length of 4 KB.
249+
* String values are UTF-8 encoded and can have a maximum length of 4 KB.
250250

251251
* **Depth**: The maximum depth of JSON objects in tags, desired properties, and reported properties is 10. For example, the following object is valid:
252252

@@ -294,7 +294,7 @@ For example, consider the following JSON fragment for reported properties. Read-
294294
"reported" : {
295295
"intProperty" : 14000,
296296
"boolProperty" : true,
297-
"floatProperty" : 1.463E+2,
297+
"floatProperty" : 1.463E+200,
298298
"stringProperty" : "This is a string value",
299299
"objectProperty" : {
300300
"property1" : 1,
@@ -307,10 +307,10 @@ For example, consider the following JSON fragment for reported properties. Read-
307307
The size of the reported properties for this fragment would be computed based on the UTF-8 encoded value of the following JSON, which represents the value of `properties/reported` with the white-space removed:
308308

309309
```json
310-
{"intProperty":14000,"boolProperty":true,"floatProperty":1.463E+2,"stringProperty":"This is a string value","objectProperty":{"property1":1,"property2":2}}
310+
{"intProperty":14000,"boolProperty":true,"floatProperty":1.463E+200,"stringProperty":"This is a string value","objectProperty":{"property1":1,"property2":2}}
311311
```
312312

313-
This yields a length of 155 bytes.
313+
This yields a length of 157 bytes.
314314

315315
IoT Hub rejects with an error all operations that would increase the size of the `tags`, `properties/desired`, or `properties/reported` documents above the limit.
316316

articles/iot-hub/iot-hub-devguide-module-twins.md

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ author: chrissie926
55
ms.service: iot-hub
66
services: iot-hub
77
ms.topic: conceptual
8-
ms.date: 04/26/2018
8+
ms.date: 02/01/2020
99
ms.author: menchi
1010
---
1111

@@ -231,11 +231,15 @@ The [Azure IoT device SDKs](iot-hub-devguide-sdks.md) make it easy to use the pr
231231

232232
Tags, desired properties, and reported properties are JSON objects with the following restrictions:
233233

234-
* All keys in JSON objects are case-sensitive 64 bytes UTF-8 UNICODE strings. Allowed characters exclude UNICODE control characters (segments C0 and C1), and `.`, SP, and `$`.
234+
* **Keys**: All keys in JSON objects are case-sensitive 64 bytes UTF-8 UNICODE strings. Allowed characters exclude UNICODE control characters (segments C0 and C1), and `.`, SP, and `$`.
235235

236-
* All values in JSON objects can be of the following JSON types: boolean, number, string, object. Arrays are not allowed. The maximum value for integers is 4503599627370495 and the minimum value for integers is -4503599627370496.
236+
* **Values**: All values in JSON objects can be of the following JSON types: boolean, number, string, object. Arrays are not allowed.
237237

238-
* All JSON objects in tags, desired, and reported properties can have a maximum depth of 5. For instance, the following object is valid:
238+
* Integers can have a minimum value of -4503599627370496 and a maximum value of 4503599627370495.
239+
240+
* String values are UTF-8 encoded and can have a maximum length of 512 bytes.
241+
242+
* **Depth**: All JSON objects in tags, desired, and reported properties can have a maximum depth of 5. For instance, the following object is valid:
239243

240244
```json
241245
{
@@ -257,14 +261,38 @@ Tags, desired properties, and reported properties are JSON objects with the foll
257261
}
258262
```
259263

260-
* All string values can be at most 512 bytes in length.
261-
262264
## Module twin size
263265

264-
IoT Hub enforces an 8 KB size limit on the value of `tags`, and a 32 KB size limit each on the value of `properties/desired` and `properties/reported`. These totals are exclusive of read-only elements.
266+
IoT Hub enforces an 8 KB size limit on the value of `tags`, and a 32 KB size limit each on the value of `properties/desired` and `properties/reported`. These totals are exclusive of read-only elements like `$etag`, `$version`, and `$metadata/$lastUpdated`.
265267

266268
The size is computed by counting all characters, excluding UNICODE control characters (segments C0 and C1) and spaces that are outside of string constants.
267269

270+
For example, consider the following JSON fragment for reported properties. Read-only elements like `$version` and `$metadata/$lastUpdated` are not shown as they are excluded from computation of the property size limit.
271+
272+
```json
273+
"properties" : {
274+
...
275+
"reported" : {
276+
"intProperty" : 14000,
277+
"boolProperty" : true,
278+
"floatProperty" : 1.463E+200,
279+
"stringProperty" : "This is a string value",
280+
"objectProperty" : {
281+
"property1" : 1,
282+
"property2" : 2
283+
}
284+
}
285+
}
286+
```
287+
288+
The size of the reported properties for this fragment would be computed based on the UTF-8 encoded value of the following JSON, which represents the value of `properties/reported` with the white-space removed:
289+
290+
```json
291+
{"intProperty":14000,"boolProperty":true,"floatProperty":1.463E+200,"stringProperty":"This is a string value","objectProperty":{"property1":1,"property2":2}}
292+
```
293+
294+
This yields a length of 157 bytes.
295+
268296
IoT Hub rejects with an error all operations that would increase the size of those documents above the limit.
269297

270298
## Module twin metadata

0 commit comments

Comments
 (0)