Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
11-21-2022 07:06 AM
Does anyone knows what is the function to get multiple of occurrences of an item in a list as list of indexes.
example:
with fun(iList,"item") as occurencesOfItem
unwind occurencesOfItems
....
Solved! Go to Solution.
11-21-2022 08:25 AM
I am not sure I understand your requirement. I think you want a method of deriving the indexes of a given item from a list of elements. If so, the following demonstrates a solution for a list of integers. The result of executing the cypher is [2,4], which is index positions of each occurrence of '6'.
with [3, 4, 6, 2, 6, 3, 7] as x, 6 as item
return [i in range(0,size(x)-1) where x[i] = item] as indexes
Is this what you are looking for?
11-21-2022 08:25 AM
I am not sure I understand your requirement. I think you want a method of deriving the indexes of a given item from a list of elements. If so, the following demonstrates a solution for a list of integers. The result of executing the cypher is [2,4], which is index positions of each occurrence of '6'.
with [3, 4, 6, 2, 6, 3, 7] as x, 6 as item
return [i in range(0,size(x)-1) where x[i] = item] as indexes
Is this what you are looking for?
11-21-2022 09:14 AM
I replied earlier but the reply lost.
thank you so much glilienfield. it amazing. it works great!!.
All the sessions of the conference are now available online