[Neo] getRelationships(RelationshipType... types)

Anders Nawroth anders at neotechnology.com
Wed Feb 24 10:04:47 CET 2010


This question was answered in this thread on the neo4jrb mailing list:

http://groups.google.com/group/neo4jrb/browse_thread/thread/69315995dd28fa19

/anders

Sumanth Thikka wrote:
> Hi,
> 
> I am newbie to neo4j and I am enjoying it.
> 
> I have started to create nodes, relationships and assigning properties to
> the nodes etc.
> I've got a problem in accessing relationships of a node.
> 
> If 'knows = DynamicRelationshipType.withName("KNOWS")' is a relation
> defined.
> 
> When a relationship 'knows' is formed from node1 to node2, I should be able
> to access relationship of node1 by one of node1.getRelationships()
> or node1.getRelationships(knows, direction)
> or node1.getRelationships(direction) or node1.getRelationships(knows)
> methods.
> 
> There is no problem with the first three, but the last method throws an
> error.
> Error is:
>          NameError: no getRelationships with arguments matching [class
> org.neo4j.graphdb.DynamicRelationshipType] on object
> #<#<Class:01xf38cf0>:0x1aa0a15>
> 
> From the documentation of node1.getRelationships(RelationshipType... types),
> I sense that 'types' is a little different from 'knows' .
> 
> Please help me understand how types needs to be passed to the
> method node1.getRelationships(RelationshipType... types).
> 
> Thanks,
> T.Sumanth
> _______________________________________________
> Neo mailing list
> User at lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user


More information about the User mailing list