Last active
August 29, 2015 14:06
-
-
Save andreasronge/d2ef06c65b20fcdbbd7f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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