cancel
Showing results forΒ
Did you mean:Β

## find loops with datetime as relationships in increasing order

Node

My objective is to find loops with Datetime as relationships in increasing order

merge (m)-[ : BuysFrom{weight1: row.Datetime, weight2: row.amount}]-->(n)

return m,n

I need to find loops where Datetimes should be in increasing order. I have used the cypher like this

match p=(n)-[*1..5]->(n) return nodes(p). But unable to find Datetimes are in ASC order in the loops . Let me know some solution.

3 REPLIES 3
Neo4j

@TRRAO I didn't understand your question completely. Are you trying to find, out of all the loops, only the ones that have the Datetime in ascending order? Are you trying to find the unique loops where the "start" of the loop has the lowest possible date? Or are you trying to find something else

Hi @steggy I want to find all the loops.  we need to retrieve the loops such that the Datetime in edge relationships should be in ascending order. For example,

first loop -- 31-07-2014 9.00.00

Second loop -- 31-07-2014 9.15.03 and so on.

So in all the loops the Datetime ( in relationships/edges) values are in ascending  order.

Hi @steggy, What you said is right.  Trying to find the unique loops where the "start" of the loop has the lowest possible date.

we need to retrieve the loops such that the Datetime in edge relationships should be in ascending order. For example,

first loop -- 31-07-2014 9.00.00

Second loop -- 31-07-2014 9.15.03 and so on.

So in all the loops the Datetime ( in relationships/edges) values are in ascending  order.