Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
09-07-2022 07:09 PM
Hello there,
With neo4j desktop, we can see the outputs with either Table view and Text view.
I find the Table output to be much richer than Text view, since it provides information such as identity, start, end. I need those information to reconstruct the graph programmatically.
Is there a way to generate Table view output with cypher-shell?
09-07-2022 08:01 PM
You could place your query in a file and use cypher-shell to execute it and write the results to a file. By default, the output will be comma delimited. Here is the syntax I tested with, where test.cypher had my cypher and the output saved to result.txt. You can process the comma delimited file as a csv file or a plan text file.
cypher-shell -u <username> -p <password> -f test.cypher > result.txt
09-07-2022 09:09 PM
Thanks for the proposition @glilienfield
However, the output is still missing all the IDs for the relationships & nodes.
It is the same output as the Text view in neo4j desktop - I want the Table view instead.
Table view example of a relationship data:
{
"identity": 5017,
"start": 503,
"end": 504,
"type": "LINKED",
}
I am after the identity/start/end fields. For some reason they are not showing up in Text view format.
09-08-2022 10:00 AM
you can write the query to format the data in any manner you need. You can product that output with a query like this:
match()-[r]->()
return {id: id(r), start: id(startNode(r)), end: id(endNode(r)), type:
type(r)} as relationship
Sample of one row from my database:
{
"start": 1,
"end": 2,
"id": 206,
"type": "REL"
}
All the sessions of the conference are now available online