You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/iot-hub/iot-hub-devguide-device-twins.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ ms.author: wesmc
7
7
ms.service: iot-hub
8
8
services: iot-hub
9
9
ms.topic: conceptual
10
-
ms.date: 06/10/2019
10
+
ms.date: 02/01/2020
11
11
---
12
12
13
13
# Understand and use device twins in IoT Hub
@@ -246,7 +246,7 @@ Tags, desired properties, and reported properties are JSON objects with the foll
246
246
247
247
* Integers can have a minimum value of -4503599627370496 and a maximum value of 4503599627370495.
248
248
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.
250
250
251
251
* **Depth**: The maximum depth of JSON objects in tags, desired properties, and reported properties is 10. For example, the following object is valid:
252
252
@@ -294,7 +294,7 @@ For example, consider the following JSON fragment for reported properties. Read-
294
294
"reported" : {
295
295
"intProperty" : 14000,
296
296
"boolProperty" : true,
297
-
"floatProperty" : 1.463E+2,
297
+
"floatProperty" : 1.463E+200,
298
298
"stringProperty" : "This is a string value",
299
299
"objectProperty" : {
300
300
"property1" : 1,
@@ -307,10 +307,10 @@ For example, consider the following JSON fragment for reported properties. Read-
307
307
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:
308
308
309
309
```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}}
311
311
```
312
312
313
-
This yields a length of 155 bytes.
313
+
This yields a length of 157 bytes.
314
314
315
315
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.
Copy file name to clipboardExpand all lines: articles/iot-hub/iot-hub-devguide-module-twins.md
+35-7Lines changed: 35 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ author: chrissie926
5
5
ms.service: iot-hub
6
6
services: iot-hub
7
7
ms.topic: conceptual
8
-
ms.date: 04/26/2018
8
+
ms.date: 02/01/2020
9
9
ms.author: menchi
10
10
---
11
11
@@ -231,11 +231,15 @@ The [Azure IoT device SDKs](iot-hub-devguide-sdks.md) make it easy to use the pr
231
231
232
232
Tags, desired properties, and reported properties are JSON objects with the following restrictions:
233
233
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 `$`.
235
235
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.
237
237
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:
239
243
240
244
```json
241
245
{
@@ -257,14 +261,38 @@ Tags, desired properties, and reported properties are JSON objects with the foll
257
261
}
258
262
```
259
263
260
-
* All string values can be at most 512 bytes in length.
261
-
262
264
## Module twin size
263
265
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`.
265
267
266
268
The size is computed by counting all characters, excluding UNICODE control characters (segments C0 and C1) and spaces that are outside of string constants.
267
269
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
+
268
296
IoT Hub rejects with an error all operations that would increase the size of those documents above the limit.
0 commit comments