You're correct in principle, but it's not a new "query" as such that is
sent every time. The traversal state is kept between calls to hasNext/next,
but that's just a detail.

On Wed, Jan 27, 2016 at 1:20 PM, Radheshyam Verma <[email protected]>
wrote:

> Thanks for the reply,
> So you mean that for each iteration of following 'FOR' loop, a query is
> sent to get next node from database if it exists.
> and that not all the nodes are returned in one go before 'FOR' loop even
> starts.
>
> for(Node currentNode : database.traversalDescription()
>                 .depthFirst()
>                 .uniqueness(Uniqueness.NODE_GLOBAL)
>                 .order(BranchOrderingPolicies.PREORDER_BREADTH_FIRST)
>                 .relationships(<RelationshipType>, Direction.BOTH)
>                 .evaluator(Evaluators.excludeStartPosition())
>                 .traverse(node)
>                 .nodes())
>         {
>
>         }
>
> Thanks for the response again.
>
>
> On Wed, Jan 27, 2016 at 2:24 PM, Mattias Persson <
> [email protected]> wrote:
>
>> With the traversal framework, the actual work of traversing happens
>> lazily on every call on hasNext/next on the returned Traverser (in the end
>> Iterator<Path>). You can simply stop pulling more paths after a certain
>> number of paths have been extracted.
>>
>>
>> On Monday, January 25, 2016 at 8:31:37 AM UTC+1, Radheshyam Verma wrote:
>>>
>>> Hi,
>>> I am using traversal framework to traverse graph which returns nodes.
>>> Can we somehow specify a limit on number of nodes which the traversal
>>> returns like we do in Query using "LIMIT" and "SKIP".
>>> Thanks.
>>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Neo4j" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/neo4j/2A1QiEOwofU/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> [email protected].
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Neo4j" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/neo4j/2A1QiEOwofU/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Mattias Persson
Neo4j Hacker at Neo Technology

-- 
You received this message because you are subscribed to the Google Groups 
"Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to