Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update json.mdx #304

Merged
merged 3 commits into from
Nov 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/content/docs/extensions/json.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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]})});
Expand All @@ -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"} │
Expand All @@ -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:
```
Expand Down Expand Up @@ -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"
```
```