neo4j-contrib / neo4j-apoc-procedures

Awesome Procedures On Cypher for Neo4j - codenamed "apoc"                     If you like it, please ★ above ⇧            
https://neo4j.com/labs/apoc
Apache License 2.0
1.68k stars 494 forks source link

add a an amount (row) based limit like apoc.util.sleep #376

Open jexp opened 7 years ago

jexp commented 7 years ago
call apoc.cypher.run('
match (n)
return n
', {maxRows: 10000})

or sth like the one below which kinda tracks returned rows with each call (in threadlocal) or as aggregation function in 3.2

match (n)
return *, maxRows(1000)
conker84 commented 3 years ago

@jexp Is this still valid?

jexp commented 1 year ago

This is meant for the following use-case.

A query is constructed dynamically or passed in by a part of the app as parameter As you don't know if that query has already a limit or not and you might want a smaller limit, without having to parse and patch the query, the idea is to stop fetching from the iterator and close the result after the maxRows

jexp commented 1 month ago

Can do this now with subqueries?