docs/dev_manual_examples.rb
######################################
# Session API - Simple Session
# Retain results for further processing
######################################
Session API - Simple Session
Retain results for further processing
Session API - Simple Session Retain results for further processing
def add_employees(company_name)
  driver.session do |session|
    persons = session.read_transaction(&method(:match_person_nodes))
    persons.sum do |person|
      session.writeTransaction do |tx|
        tx.run('MATCH (emp:Person {name: $person_name}) ' \
               'MERGE (com:Company {name: $company_name}) ' \
               'MERGE (emp)-[:WORKS_FOR]->(com)',
               person_name: person[:name], company_name: company_name)
        1
      end
    end
  end
end
def add_employees ( company_name ) driver . session do | session | persons = session . read_transaction ( & method ( :match_person_nodes ) ) persons . sum do | person | session . writeTransaction do | tx | tx . run ( 'MATCH (emp:Person {name: $person_name}) ' 'MERGE (com:Company {name: $company_name}) ' 'MERGE (emp)-[:WORKS_FOR]->(com)' , person_name : person [ :name ] , company_name : company_name ) 1 end end end end
Session API - Simple Session
Retain results for further processing
Session API - Simple Session Retain results for further processing
company_name
<not_specific>