Skip to content

Instantly share code, notes, and snippets.

@vumanhcuongit
Last active August 29, 2015 14:06
Show Gist options
  • Select an option

  • Save vumanhcuongit/d6080c16041cd9480e12 to your computer and use it in GitHub Desktop.

Select an option

Save vumanhcuongit/d6080c16041cd9480e12 to your computer and use it in GitHub Desktop.
neo4j cheat sheet
# Create Server Object
Server.create(os: 'Windows', ram: 8)
# Create Service Object
Service.create(type: 'HAD23W', service_id: 1532, ip: '192.168.1.1')
# Create Customer Object
Customer.create(name:'Cuong Vu', email:'[email protected]')
# One service belongs to One server
Server.last.services << Service.last
# One customer belongs to One service
Service.last.customers << Customer.last
# Get emails of customers from Server
Server.last.services.customers(:c).pluck(c: :email)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment