External querying and export


(Pivotpab) #1

Hi All,

I really apologise if I'm writing this all wrong as it's my first post and I'm new to neo4j.

I simply want to find an external tool that I can connect to neo4j dB with to query the json.

Ideally I'm looking for a way to automate the export of a csv file via a tool each morning... That will query the DB, and return the results as a table within the csv file.

I'm. Sorry if I've not provodes enough info. Please do let me know.

Any help is appreciated


(Michael Hunger) #2

Not 100% sure what you need, like a cron job?

You could use cypher-shell with a cypher query to gather your data.

cat data-export.cypher | bin/cypher-shell -u username -p password


(Pivotpab) #3

Thanks for replying Michael. This is interesting.

So basically I want to query Neo4j using Match and Return. A scenario would be to have a batch file execute a tool (perhaps Cypher shell) that has the query stored that will run against Neo4j and export the results to file (e.g. CSV)

I guess then the batch could add the file to a specific folder. Would Cypher shell query and export from a local machine (with the right perms)?

Thanks


(Michael Hunger) #4

Cypher shell runs on the machine you run it on.
It can connect to remote neo4j servers.

You can redirect the output to a file (which might have a date suffix)
And the statements to run can come from a file too

For details on how to do this on your system I recommend to talk to your ops/devops/admin folks.