-
Notifications
You must be signed in to change notification settings - Fork 80
Node
mgamba edited this page Nov 18, 2014
·
5 revisions
Example, create a node with one property (name
= andreas
) with two labels red
and green
node = Neo4j::Node.create({name: 'andreas'}, :red, :green)
puts "Created node #{node[:name]} with labels #{node.labels.join(', ')}"
Setting properties
node = Neo4j::Node.create({name: 'andreas'}, :red, :green)
node[:name] = 'changed name' # changes immediately one property
node[:name] # => 'changed name'
node.props # => {name: 'changed name'}
node.props={ foo: 42} # replace all properties
node.update_props( bar: 42) # keeps old properties (unlike #props=) update with given hash
Notice, nodes will be indexed based on which labels they have.
WARNING: Much of the information in this wiki is out of day. We are in the process of moving things to readthedocs