RNeo4j (version 1.6.4)

startNode: Retrieve Nodes from Relationships or Paths

Description

Retrieve the start node from a relationship or path object.

Usage

startNode(object)

Arguments

object
A relationship or path object.

Value

A node object.

See Also

endNode

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")
# 
# rel = createRel(alice, "WORKS_WITH", bob)
# 
# startNode(rel)
# 
# query = "
# MATCH p = (a:Person)-[:WORKS_WITH]->(b:Person)
# WHERE a.name = 'Alice' AND b.name = 'Bob'
# RETURN p
# "
# 
# path = getSinglePath(graph, query)
# 
# startNode(path)
# ## End(Not run)

Run the code above in your browser using DataLab