I can't figure out how to use neo4j-ogm to generate a (single) query that will delete n records.
I'd like to write some OGM code that achieves something like this:
MATCH (n: Artist) WITH n SKIP 0 LIMIT 100 DELETE n
But my code (below) generates one of these queries:
MATCH (n:`Artist`) WITH n SKIP 0 LIMIT 100 RETURN n - {}
Followed by 100 queries like this:
MATCH (n) WHERE ID(n) = $id OPTIONAL MATCH (n)-[r0]-() DELETE r0, n - {id: 15992}
MATCH (n) WHERE ID(n) = $id OPTIONAL MATCH (n)-[r0]-() DELETE r0, n - {id: 15993}
...
Here is my ogm code:
Pagination pagination = new Pagination(0, 100);
Session session = getSession.get();
Collection<Artist> records = session.loadAll(Artist.class, pagination, DEPTH_LIST);
session.delete(records);
Any help is appreciated, thank you!