Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
10-05-2022 02:33 AM
I have multiple json files in a folder. Possible to read whole folder and import all or do I have to specify file by file?`
Solved! Go to Solution.
10-05-2022 05:24 AM
Looks like you can do this using APOC procedure to give a list of files in a folder or all sub folders. The documentation has an example of what you want to do.
https://neo4j.com/labs/apoc/4.4/overview/apoc.load/apoc.load.directory/
10-05-2022 05:24 AM
Looks like you can do this using APOC procedure to give a list of files in a folder or all sub folders. The documentation has an example of what you want to do.
https://neo4j.com/labs/apoc/4.4/overview/apoc.load/apoc.load.directory/
10-08-2022 10:38 AM
For who need some help on this:
Here is an example code that worked for me using apoc.load.directory and after apoc.load.json to read data every all json files.
CALL apoc.load.directory("*.json", "json")
YIELD value as files
UNWIND files as file
CALL apoc.periodic.iterate('
CALL apoc.load.json($file)
YIELD value as line
', '
//UNWIND $listOfMaps AS properties
//CREATE (n: Product2) SET n = properties
CREATE (pc:Product2{catalogPathID: line.catalogPathID}) //Process line here
', {batchSize:10000, parallel:true, params: {file: file}})
YIELD batches, total, updateStatistics
RETURN batches, total, updateStatistics
All the sessions of the conference are now available online