The IN TRANSACTIONS clause runs a Cypher subquery in batches of separate transactions. It is useful when importing large CSV files because smaller transactions reduce the risk of running out of memory. section 3.2.5
A typical batched import follows these steps:
- Define CALL {} as a Cypher subquery and import enclosing variables with WITH. section 3.2.5
- Append IN TRANSACTIONS so the subquery executes across batches; the default batch size is 1,000 rows. section 3.2.5
Import follower relationships
Use :auto in Neo4j Browser, then load the follower CSV, match existing User nodes, and merge each FOLLOWS relationship inside the batched subquery. A file with almost 25,000 rows is split into about 25 transactions by the default batch size. section 3.2.5
