简体   繁体   中英

Fix random seed in Neo4j

I wonder how you would fix the seed of a random number generator in Neo4j in order to make reproducible tries for development purposes. For instance, how would you fix the seed in the following example so that it always yields the same output?

MATCH (p:Person)-[:KNOWS]->() 
WHERE rand() < 0.25
RETURN p LIMIT 100

I checked and I can confirm this is not supported at the moment. Implementation-wise , the function relies on ThreadLocalRandom which does even support custom seeds.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM