I am trying to return only nodes with a relationship of a given type in a traversal using the REST API. The traversing of relationships is working correctly, and I can successfully filter on properties, but I would like to return only nodes with relationships of a given type, and it is not one of the relationship types I am traversing. The problem is, every node is showing as having no relationships in the return filter body. below is a traverser that I have tried to use as a simplified test and got back no results. If I add in a return true line before the current return statement, I get back every node that has been traversed. Does getRelationships() work in a return filter? It isn't possible that a node I have traversed to has no relationships, so I am wondering if I am doing something wrong. the status code is 200, the result is just an empty JSON array unless I add in code to filter on some other criteria that returns true for some nodes.
{"order":"depth_first", "uniqueness":"node_path", "return filter":{ "body":"(function eval(pos) { var node = pos.endNode(); var rels = pos.endNode().getRelationships(); var relIt = rels.iterator(); return relIt.hasNext(); })(position);", "language":"javascript" }, "max depth":2, "relationships":[{"direction":"out","type":"USED"}] } Thanks, Michael A -- View this message in context: http://neo4j-user-list.438527.n3.nabble.com/get-relationships-on-node-during-REST-traversal-tp3173391p3173391.html Sent from the Neo4J User List mailing list archive at Nabble.com. _______________________________________________ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user