mzee
mzee

Reputation: 55

Method for linking nodes in time order

I have an existing graph in Neo4j. I stored the event datetime in APOC in the node. I want to create relationships between nodes in time order. (First event)--(second event)--(third event) etc.

Is there a way to do this programmatically?

Upvotes: 0

Views: 49

Answers (1)

InverseFalcon
InverseFalcon

Reputation: 30397

Yes, you can match on the nodes, order them by the event datetime, collect them, then use apoc.nodes.link() to create the desired relationships between them.

Upvotes: 1

Related Questions