diff --git a/src/content/docs/extensions/json.mdx b/src/content/docs/extensions/json.mdx index fdb737f1..0b7aca95 100644 --- a/src/content/docs/extensions/json.mdx +++ b/src/content/docs/extensions/json.mdx @@ -524,8 +524,8 @@ it then creates two `json` objects in this column using `to_json` function, and Example: ```cypher -// INSTALL json; -// LOAD EXTENSION json; +INSTALL json; +LOAD EXTENSION json; CREATE NODE TABLE Person (id INT64, description JSON, primary key(id)); CREATE (p:Person {id: 20, description: to_json({height: 52, age: 32, scores: [1,2,5]})}); @@ -537,7 +537,7 @@ Result: ``` ┌───────┬────────────────────────────────────────────────┐ │ p.id │ p.description │ -│ INT64 │ STRING │ +│ INT64 │ json │ ├───────┼────────────────────────────────────────────────┤ │ 20 │ {"height":52,"age":32,"scores":[1,2,5]} │ │ 40 │ {"age":55,"scores":[1,32,5,null],"name":"dan"} │ @@ -548,8 +548,8 @@ You can then query on these properties as follows: ```cypher MATCH (p:Person) -WHERE p.description.age < 50 -RETURN p.id AS id, p.description.age AS age +WHERE json_extract(p.description, 'age') < 50 +RETURN p.id AS id, json_extract(p.description, 'age') AS age; ``` Result: ``` @@ -870,4 +870,4 @@ UNWIND ['[ {"a": [1], "b": 2,"c": 1}, 1, 5, 9]', '[1, 2, 3]', '"a [{"a":[1],"b":2,"c":1},1,5,9] [1,2,3] "ab" -``` \ No newline at end of file +```