Skip to content
maxdemarzi edited this page Jan 24, 2013 · 4 revisions

Creation

Neography::Node.create                                               # Create an empty node
Neography::Node.create("age" => 31, "name" => "Max")                 # Create a node with some properties
@neo2 = Neography::Rest.new({:server => '192.168.10.1'})
Neography::Node.create({"age" => 31, "name" => "Max"}, @neo2)        # Create a node on the server defined in @neo2

Loading

Neography::Node.load(5)                                              # Get a node and its properties by id
Neography::Node.load(existing_node)                                  # Get a node and its properties by Node
Neography::Node.load("http://localhost:7474/db/data/node/2")         # Get a node and its properties by String
Neography::Node.load(5, @neo2)                                       # Get a node on the server defined in @neo2

Finding

Neography::Node.find(index, key, value)                              # advanced query of the node index with the given key/value pair
Neography::Node.find(index, query)                                   # advanced query of the node index with the given query

Deletion and existence

n1 = Node.create
n1.del                                                               # Deletes the node
n1.exist?                                                            # returns true/false if node exists in Neo4j
Clone this wiki locally