2
votes

I am new to Neo4j, and I read the documentation for traverse part by REST, there is an example here:

http://neo4j.com/docs/milestone/rest-api-traverse.html#rest-api-traversal-using-a-return-filter

{ "order" : "breadth_first", "return_filter" : { "body" : "position.endNode().getProperty('name').toLowerCase().contains('t')", "language" : "javascript" },

Is anybody can tell me what I can find the information about position, endNode(),getProperty...., it likes an embedded javascript function, but i do not know the meaning of it.

Thanks.

1

1 Answers

1
votes

To quote the Traversals documentation:

The position object in the body of the return_filter and prune_evaluator is a Path object representing the path from the start node to the current traversal position.

You can start with the JavaDoc for Path.endNode() to understand how to interpret the return_filter.

[ADDENDUM, to answer a comment]

If you want to filter the traversal by label, you can use Node.hasLabel(), like this:

"return_filter" : {
  "body" : "position.endNode().hasLabel(DynamicLabel.label('t'))",
  "language" : "javascript"
}