json_type

json_type(JsonDocument)

The json_type function returns the type of the JSON object or element. Valid responses are:

  • OBJECT

  • ARRAY

  • STRING

  • INTEGER

  • DOUBLE

  • NULL

  • BOOLEAN

Assuming a field Json containing: "items" : [ "Num" : 1, "Text" : "The Name", "First" : true , "Num" : 2.0, "Text" : "The second one", "First" : false , null ]

json_type(Json): OBJECT
json_type(Json.$.items[0]): OBJECT
json_type(Json.$.items): ARRAY
json_type(Json.$.items[0].Num): INTEGER
json_type(Json.$.items[1].Num): DOUBLE
json_type(Json.$.items[0].Text): STRING
json_type(Json.$.items[0].First): BOOLEAN
json_type(Json.$.items[2]): NULL


Copyright © Thunderstone Software     Last updated: Jul 22 2021
Copyright © 2021 Thunderstone Software LLC. All rights reserved.