Skip to content

Commit

Permalink
node: new properties in phase 2
Browse files Browse the repository at this point in the history
  • Loading branch information
maxdemarzi committed Dec 5, 2010
1 parent 4541ce9 commit 7182516
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ Experimental:
another_node = @neo.create_node("age" => 31, "name" => "Max")
nodes = @neo.get_nodes([one_set_nodes, another_node]) # Get four nodes

Phase 2 (work in progress):
=== Phase 2 (work in progress):

Now we are returning full objects. The properties of the node or relationship can be accessed directly (node.name).
The Neo4j ID is available by using node.neo_id .
Expand All @@ -144,8 +144,10 @@ The Neo4j ID is available by using node.neo_id .
my_node = Node.create("age" => 31, "name" => "Max")
my_node[:age] #returns 31 # Get a node property using [:key]
my_node.name #returns "Max" # Get a node property as a method
my_node[:age] = 24 #changes age to 24 # Set a node property using [:key] =
my_node.name = "Alex" #changes name to "Alex" # Set a node property as a method
my_node[:age] = 24 # Set a node property using [:key] =
my_node.name = "Alex" # Set a node property as a method
my_node[:hair] = "black" # Add a node property using [:key] =
my_node.weight = 190 # Add a node property as a method
my_node[:name] = nil # Delete a node property using [:key] = nil
my_node.name = nil # Delete a node property by setting it to nil

Expand Down

0 comments on commit 7182516

Please sign in to comment.