Skip to content

Cursors

A cursor streams a large result, reading it from the driver batch_size rows at a time:

spec = CursorSpecification[Route]("MATCH (r:Route) RETURN properties(r)").batch_size(500).transform(Route)
async with await pm.open_cursor(spec) as cursor:
async for route in cursor:
...

It works in a transaction or outside one, where it has a connection of its own until it is closed.