On my AWS hosted Neo4j server I have a large dataset ingested. Versions in use are neo4j:3.5.5-enterprise and apoc-3.5.0.4. I want to examine a subset of the dataset on my laptop, so I want to export the subset and create my data.cypher file like this:
call apoc.export.cypher.query(
"
MATCH (a:Author {name: '$NAME'})
WITH a
OPTIONAL MATCH (u:UnknownAuthor)-[:MAYBE]-(a)
WITH collect(u)+collect(a) AS authors
UNWIND authors as a
MATCH (a)-[:WROTE]-(p:Paper)
WITH a, p
OPTIONAL MATCH (p)-[]-(n)
return *
",
'/data.cypher',{format:'cypher-shell'});
Both the AWS and my local Neo4j run in Docker containers. So I retrieve it from the Docker container
docker cp neo4j:/var/lib/neo4j/import/data.cypher data.cypher
Then I download the data.cypher file to my laptop and attempt to ingest it into my local, empty Neo4j container:
docker cp data.cypher neo4j:/var/lib/neo4j/import/data.cypher
echo "starting cypher shell"
docker exec -it neo4j \
sh -c 'cat /var/lib/neo4j/import/data.cypher | /var/lib/neo4j/bin/cypher-shell --format plain'
Unfortunately this doesn't work and I receive this error message:
Invalid input '}': expected whitespace, comment or a property key name (line 2, column 61 (offset: 61))
"UNWIND [{id:"3647617", properties:{name:"Allen Macpherson", }}, {id:"47022847", properties:{name:"Julia E. Anderson", }}, --- REST OMITTED ---] as row"
^
How can I import this file?