Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
05-22-2019 08:04 AM
so i have a cypher query that returns a json formated values in when using neo4j browser as follows:
Model: Restaurant ->in_plaza->Plaza
Cypher Query:
MATCH r=(p:Plaza)-[:in_plaza]->(rs:Restaurant) WITH COLLECT(r) AS rs CALL apoc.convert.toTree(rs, true, { nodes: {Plaza: ['name'], Restaurant: ['name', 'address']} }) yield value RETURN value
the following are the snapshot of results from neo4j browser
However when i use the api, i get verbose results e.g. unneeded meta data, each record gets wrapped in a row array as follows
The end point i'm using is a post request :
https://----------:7473/db/data/transaction/commit with the query above in the body as follows:
{
"statements": [
{
"statement": "MATCH r=(p:Plaza)-[:in_plaza]->(rs:Restaurant) WITH COLLECT(r) AS rs CALL apoc.convert.toTree(rs, true, { nodes: {Plaza: ['name'], Restaurant: ['name', 'address']} }) yield value RETURN value"
}
]
}
05-22-2019 04:04 PM
seems there's now way around the verbose results other than adding a stop to flattening the json object. In my case i'm using an azure function (same like aws lamda) to flatten query results.
All the sessions of the conference are now available online