Skip to content
Andreas Ronge edited this page Aug 25, 2014 · 5 revisions

Creating Nodes

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.map(&:name).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

Api

Contribute

Clone this wiki locally