cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Get less verbose response from the Neo4j api same as table data / text when using Neo4j browser

melgamal
Node Link

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"
}
]
}

1 REPLY 1

melgamal
Node Link

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.