You can use the cypher-shell command-line tool to execute your cypher statement and it will show the result set on your terminal window by default.
You can also use cypher-shell with Linux redirection to stream your cypher result set to your local desktop file system. Here is an example:
#!/bin/bash
# export-user-node.cypher to export all the nodes:User to local file in JSON format
export NEO4J_USERNAME='customer-neo4j-user-name'
export NEO4J_PASSWORD='Aura-very-long-password'
CypherQueryStatement="MATCH (u:User) RETURN {displayName:u.displayName, ipv4:u.ipv4, countryCode:u.countryCode})"
echo ${CypherQueryStatement}
echo ${CypherQueryStatement} | \
cypher-shell --format plain -a neo4j+s://1234abcd.databases.neo4j.io > User.json
After executing this shell script, nodes with :User labels will be exported to the User.json file with all the properties specified in the Cypher query statement.
Comments
0 comments
Please sign in to leave a comment.