Skip to content

Instantly share code, notes, and snippets.

@andreasronge
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andreasronge/d2ef06c65b20fcdbbd7f to your computer and use it in GitHub Desktop.
Save andreasronge/d2ef06c65b20fcdbbd7f to your computer and use it in GitHub Desktop.
# Create a node with on property name='andreas', and one label 'Human'
andreas = Neo4j::Node.create({name: 'andreas'}, :Human)
duchess = Neo4j::Node.create({name: 'duchess', character: 'posh'}, :Animal, :Cat)
kim = Neo4j::Node.create({name: 'kim', age: 1}, :Animal, :Cat)
# Create a relationship of type pets between andreas and duchess
# Relationships can also have properties
andreas.create_rel(:pets, duchess, since: 2014)
andreas.create_rel(:pets, kim, since: 2014)
duchess.create_rel(:kittens, kim)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment