Well, fromDepth is public static Evaluator fromDepth( final int depth ) { return new Evaluator() { public Evaluation evaluate( Path path ) { return path.length() < depth ? Evaluation.EXCLUDE_AND_CONTINUE : Evaluation.INCLUDE_AND_CONTINUE; } }; }
So it is inclusive. Given these, fromDepth(1) && toDepth(1) will not return anything. Have not checked though. Feels like you have a point there. Mattias, WDYT? Also, atDepth(0) should return the start node? public static Evaluator atDepth( final int depth ) { return new Evaluator() { public Evaluation evaluate( Path path ) { return path.length() < depth ? Evaluation.EXCLUDE_AND_CONTINUE : Evaluation.INCLUDE_AND_PRUNE; } }; } /peter 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 - NOSQL for the Enterprise. http://startupbootcamp.org/ - Öresund - Innovation happens HERE. On Wed, Nov 2, 2011 at 7:51 PM, Alex <a...@auv.name> wrote: > Hi Peter > > it admittedly makes little sense to use fromDepth(0) & toDepth(0) because > there's obviously no need to run the query at all. Anyway, I'd expect a > behavior consistent with, for example fromDepth(1) & toDepth(1), which > returns only nodes at depth 1 (if I'm not mistaken). So, I'd definitely > modify the code for the sake of consistency. For the same reason, atDepth(0) > should also return the start node. > > Cheers > Alex > > -- > View this message in context: > http://neo4j-community-discussions.438527.n3.nabble.com/zero-fromDepth-and-toDepth-tp3474825p3476040.html > Sent from the Neo4j Community Discussions mailing list archive at Nabble.com. > _______________________________________________ > 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