Skip to content

Instantly share code, notes, and snippets.

@conker84
Created November 6, 2018 19:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save conker84/29b1e72bdb492b359178446770670841 to your computer and use it in GitHub Desktop.
Save conker84/29b1e72bdb492b359178446770670841 to your computer and use it in GitHub Desktop.
{
"list": [
[{
"id": 0,
"type": "relationship",
"label": "KNOWS",
"properties": {
"since": 1993
},
"start": {
"id": 0,
"labels": ["User"],
"properties": {
"born": "2015-07-04T19:32:24",
"name": "Adam",
"place": {
"crs": "wgs-84",
"latitude": 33.46789,
"longitude": 13.1,
"height": null
},
"age": 42,
"male": true,
"kids": ["Sam", "Anna", "Grace"]
}
},
"end": {
"id": 1,
"labels": ["User"],
"properties": {
"name": "Jim",
"age": 42
}
}
}]
]
}
{
"list": [{
"id": 0,
"type": "relationship",
"label": "KNOWS",
"properties": {
"since": 1993
},
"start": {
"id": 0,
"labels": ["User"]
},
"end": {
"id": 1,
"labels": ["User"]
}
}]
}
MATCH p = (u:User)-[rel]->(u2:User) RETURN COLLECT(p) as list

generates listPath.prettyPrinted.json

MATCH (u:User)-[rel:KNOWS]->(u2:User) RETURN COLLECT(rel) as list

generates listRel.prettyPrinted.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment