Last active
August 29, 2015 14:06
-
-
Save vumanhcuongit/d6080c16041cd9480e12 to your computer and use it in GitHub Desktop.
neo4j cheat sheet
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 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