Skip to main content

2.6. Semantics of null

2.6. Semantics of null

Note: JSON null is treated the same as any other JSON value, i.e., it is not taken to mean "undefined" or "missing".

2.6.1. Examples

JSON:

{"a": null, "b": [null], "c": [{}], "null": 1}

Queries:

QueryResultResultComment
Paths
$.anull$['a']Object value
$.a[0]null used as array
$.a.dnull used as object
$.b[0]null$['b'][0]Array value
$.b[*]null$['b'][0]Array value
$.b[?@]null$['b'][0]Existence
$.b[?@==null]null$['b'][0]Comparison
$.c[[email protected]==null]Comparison with "missing"
value
$.null1$['null']Not JSON null at all,
just a member name string

Table 17: Examples Involving (or Not Involving) null