// On Windows machine with eclipse+maven+neo4j_APOC pluing
/*
We need to change neo4j.conf file and need to add following lines:
apoc.export.file.enabled=true
apoc.import.file.enabled=true
Edit and uncomment #dbms.directories.plugins=plugins as given below
dbms.directories.plugins=C:/Users/FAAIZ/Downloads/neo4j-community-3.2.6/plugins
save the file and exit.
Now, download the APOC plugin apoc-3.2.0.4-all.jar from
https://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/3.2.0.4
Check the latest version of jar as per latest. For me above is the latest while writing this file and put at the location which you mentioned in dbms.directories.plugins
*/
import org.neo4j.driver.v1.*;
public class boltApoc{
public static void main(String[] args) {
Driver driver = GraphDatabase.driver("bolt://127.0.0.1:7687", AuthTokens.basic("neo4j", "neo4j"));
Session session = driver.session();
StatementResult result = session.run("CALL apoc.export.csv.query(\"match (m:Person) return m.name\",\"results.csv\",{})");
session.close();
driver.close();
}
}
/*
We need to change neo4j.conf file and need to add following lines:
apoc.export.file.enabled=true
apoc.import.file.enabled=true
Edit and uncomment #dbms.directories.plugins=plugins as given below
dbms.directories.plugins=C:/Users/FAAIZ/Downloads/neo4j-community-3.2.6/plugins
save the file and exit.
Now, download the APOC plugin apoc-3.2.0.4-all.jar from
https://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/3.2.0.4
Check the latest version of jar as per latest. For me above is the latest while writing this file and put at the location which you mentioned in dbms.directories.plugins
*/
import org.neo4j.driver.v1.*;
public class boltApoc{
public static void main(String[] args) {
Driver driver = GraphDatabase.driver("bolt://127.0.0.1:7687", AuthTokens.basic("neo4j", "neo4j"));
Session session = driver.session();
StatementResult result = session.run("CALL apoc.export.csv.query(\"match (m:Person) return m.name\",\"results.csv\",{})");
session.close();
driver.close();
}
}
Comments
Post a Comment