Currently there's no way to get a fast count of number of relationships,
but this has been worked on so that you can get number of relationships per
type/direction without actually looping through them. When it will go into
the product I don't know yet. The best you can do in the meantime is to
keep that counter as a property on each node which you update manually,
maybe even as a transaction event
handler<http://api.neo4j.org/current/org/neo4j/graphdb/GraphDatabaseService.html#registerTransactionEventHandler%28org.neo4j.graphdb.event.TransactionEventHandler%29>
.

2011/12/2 Krzysztof Raczyński <racz...@gmail.com>

> Hello folks, i've been trying to prune based on number of outgoing
> relationships, but so far i am stumped,
> since org.neo4j.graphdb.Node interface doesn't expose any way to count
> outgoing relationships. Traversal is for
> tree visualisation, and i want to avoid creating too much of a
> clutter, hence the outgoing relationship limit. My code right now:
>
>        t = neo4j.TraversalDescription().\
>            max_depth(3).relationships('rel_type','out').\
>
>  prune('javascript','position.endNode().getProperty("some_property")
> >= 192')
>
> I would like to prune nodes that have more than 10 outgoing relationships.
>
> godspeed, graphistas
> _______________________________________________
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>



-- 
Mattias Persson, [matt...@neotechnology.com]
Hacker, Neo Technology
www.neotechnology.com
_______________________________________________
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to