2.6. Semantics of null (null の意味論)
2.6. Semantics of null (null の意味論)
注: JSON の null は他の JSON 値と同様に扱われ, "undefined" や "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 を配列として使用 | ||
| $.a.d | null をオブジェクトとして使用 | ||
| $.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] | "欠落" 値との比較 | ||
| $.null | 1 | $['null'] | JSON の null ではなく, |
| メンバ名文字列にすぎない |
表17: null を含む (または含まない) 例