-1

I do have values like

first  = [1, 2]
second = [2, 3]
third  = [1, 3]

and I want to have [1,2,1] in neo4j?

Marc
  • 19,394
  • 6
  • 47
  • 51
Suman
  • 53
  • 7

1 Answers1

2

Try this:

WITH [1,2] AS first, [2,3] AS second, [1,3] AS third
RETURN [first[0]] + [second[0]] + [third[0]]

As a more generic/more elegant solution, you can also use a list comprehension:

WITH [1,2] AS first, [2,3] AS second, [1,3] AS third
RETURN [list IN [first, second, third] | list[0]]
Gabor Szarnyas
  • 4,410
  • 3
  • 18
  • 42