For reproducibility reasons, is it possible to call the rand()
function with a fixed seed? Hence the rand()
function always returns the same number. For example, in the following query, I would like to get the same list of Person
at different runs for development purposes.
MATCH (p:Person)-[:KNOWS]->()
WHERE rand() < 0.25
RETURN p LIMIT 100
A similar question was asked on Stackoverflow, and it seems random number with fixed seed is not currently supported. If correct, are there any workarounds?
As suggested in the referenced Stackoverflow question, a possible workaround is getting the list of 100 Person
storing it somewhere and using them as the output of this query. While functional, it is a bit hacky workaround.