Miklos, to limit the number of returned nodes, you would probably want to use the ReturnEvaluator not to return anything after a certain max number. If you look at https://trac.neo4j.org/browser/components/server/trunk/src/main/java/org/neo4j/server/rest/domain/EvaluatorFactory.java#L64, the script is run inside the TraversalDescription.
I have not tested it, but it seems the current evaluator script snippets are evaluated every time, and thus cannot hold state. We are working on a more complex interface, that lets you submit whole scripts as payload that have full access to the database API and let you do this kind of stuff. Also, server side extensions are coming into the next milestone, that can do this either through Java, or later with any script supported by the JVM (JRuby, JavaScript and Scala coming to mind) Sorry, this is hard to do until next week :/ Cheers, /peter neubauer GTalk: neubauer.peter Skype peter.neubauer Phone +46 704 106975 LinkedIn http://www.linkedin.com/in/neubauer Twitter http://twitter.com/peterneubauer http://www.neo4j.org - Your high performance graph database. http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party. 2010/12/10 Kiss Miklós <kissmik...@freemail.hu>: > Hello, > > where can I find a detaled documentation on how to use JavaScript to > write prune evaluators? I'm wondering if there is a way to limit the > number of returned nodes based on item count? I don't want to > accidentally download hundreds of MBs. Also I want to know the other > possibilites of neo4j using javascript. > > Thanks, > MikKi > _______________________________________________ > Neo4j mailing list > User@lists.neo4j.org > https://lists.neo4j.org/mailman/listinfo/user > _______________________________________________ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user