Sha256: aa55ef324c61fd64c758707658c0a7554d13728282d4f55cc489318e221a6189
Contents?: true
Size: 744 Bytes
Versions: 1
Compression:
Stored size: 744 Bytes
Contents
require 'rubygems' require 'neo4j-wrapper' class Company include Neo4j::NodeMixin has_n(:employees) end class Person include Neo4j::NodeMixin property :name property :age, :size, :type => Fixnum, :index => :exact property :description, :index => :fulltext has_one(:best_friend) has_n(:employed_by).from(:employees) end Neo4j::Transaction.run do Person.new(:name => 'jimmy', :age => 35) end person = Person.find(:age => (10..42)).first Neo4j::Transaction.run do person.best_friend = Person.new person.employed_by << Company.new(:name => "Foo ab") end company = person.employed_by.find { |p| p[:name] == 'Foo ab' } puts "Person #{person.name} employed by #{company[:name]}" company.employees.each {|x| puts x.name}
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
neo4j-wrapper-0.0.1-java | lib/example.rb |