Node relationships

rdvdijk edited this page Sep 26, 2012 · 3 revisions

Creation:

@neo.create_relationship("friends", node1, node2)          # Create a relationship between node1 and node2
@neo.create_unique_relationship(index_name, key, value,    # Create a unique relationship between nodes
                        "friends", new_node1, new_node2)   # this needs an existing index

Retrieval:

@neo.get_node_relationships(node1)                         # Get all relationships
@neo.get_node_relationships(node1, "in")                   # Get only incoming relationships
@neo.get_node_relationships(node1, "all", "enemies")       # Get all relationships of type enemies
@neo.get_node_relationships(node1, "in", "enemies")        # Get only incoming relationships of type enemies