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:
| Query | Result | Result | Comment |
|---|---|---|---|
| Paths | |||
| $.a | null | $['a'] | Object value |
| $.a[0] | null used as array | ||
| $.a.d | null 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 | |||
| $.null | 1 | $['null'] | Not JSON null at all, |
| just a member name string |
Table 17: Examples Involving (or Not Involving) null