Thank you again for taking the time, after rereading my request I realized that I didn't do a good job describing the issue.
My objective is to avoid a cartesian query and unwind the two lists and create relationship.
the desired result are 3 relationships (not 9) :
Employee A will_work 50 hours on Project A
Employee B will_work 60 hours on Project A
Employee C will_work 10 hours on Project A
this is a "test" that I ran without success to set a property (Temp) on Employee label
WITH "Employee A,Employee B,Employee C" as vEmployee, "50,60,10" as vHRS
FOREACH (name IN split(vEmployee, ",")|FOREACH (hrs IN split(vHRS, ",")|
MERGE (n:Employee {ID:name})
SET n.Temp=hrs))
so to summarize I need to unwind two coordinated list and create 3 relationships and set accordingly Hours.
(Employee)-[will_work]->(Project A)
SET Hours=vHRS
That can be several approaches to solve this depending on how your are setting up the data. He is an example of a way to approach it. Do you have your entire query that we can look at to modify it? Do you intend to read the data from a spreadsheet?
with ["A", "B", "C"] as employees, [50, 60, 10] as hours
unwind range(0,size(employees)-1) as index
merge(e:Employee{name:employees[index]})
merge(p:Project{name:"A"})
merge(e)-[r:WILL_WORK]->(p)
SET r.hours=hours[index]
return e, p