cancel
Showing results for 
Search instead for 
Did you mean: 

find loops with datetime as relationships in increasing order

TRRAO
Node

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

load csv with headers from 'file:///file1.csv' as row

merge(m:Buyer{name:BC})

merge(n:Buyer{name:SC})

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

steggy
Neo4j
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.

Thanks for your reply.

Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit

On November 16 and 17 for 24 hours across all timezones, you’ll learn about best practices for beginners and experts alike.