RNeo4j (version 1.6.4)

rels: Retrieve Relationships from Paths

Description

Retrieve all relationships from a path object.

Usage

rels(path)

Arguments

path
A path object.

Value

A list of relationship objects.

See Also

nodes

Examples

Run this code
## Not run: 
# graph = startGraph("http://localhost:7474/db/data/")
# clear(graph)
# 
# alice = createNode(graph, "Person", name = "Alice")
# bob = createNode(graph, "Person", name = "Bob")
# charles = createNode(graph, "Person", name = "Charles")
# 
# createRel(alice, "WORKS_WITH", bob)
# createRel(bob, "WORKS_WITH", charles)
# 
# query = "
# MATCH p = (:Person {name:'Alice'})-[:WORKS_WITH*]->(:Person {name:'Charles'})
# RETURN p
# "
# 
# path = cypherToList(graph, query)[[1]]$p
# 
# rels(path)
# ## End(Not run)

Run the code above in your browser using DataCamp Workspace