Learn R Programming

RNeo4j (version 1.6.4)

getNodes: Retrieve Nodes with Cypher Queries

Description

Deprecated. Use cypherToList. Retrieve nodes from the graph with a Cypher query.

Usage

getNodes(graph, query, ...)

Arguments

graph
A graph object.
query
A character string.
...
Parameters to pass to the query in the form key = value, if applicable.

Value

A list of node objects.

See Also

getSingleNode

Examples

Run this code
## Not run: 
# graph = startGraph("http://localhost:7474/db/data/")
# clear(graph)
# 
# createNode(graph, "Person", name = "Alice", age = 23)
# createNode(graph, "Person", name = "Bob", age = 22)
# createNode(graph, "Person", name = "Charles", age = 25)
# 
# query = "MATCH (p:Person)
#          WHERE p.age < 25
#          RETURN p"
# 
# younger_than_25 = getNodes(graph, query)
# 
# sapply(younger_than_25, function(p) p$name)
# 
# query = "MATCH (p:Person)
#          WHERE p.age > {age}
#          RETURN p"
# 
# older_than_22 = getNodes(graph, query, age = 22)
# 
# sapply(older_than_22, function(p) p$name)
# ## End(Not run)

Run the code above in your browser using DataLab