Last active
May 3, 2019 16:36
-
-
Save vladbatushkov/cb9eb9fcb266bdaec2c35939e75dcdfb to your computer and use it in GitHub Desktop.
Join working days and weekends into year day by day.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UNWIND apoc.coll.pairsMin(range(1, 365)) as pair | |
MATCH (w1) | |
WHERE (w1:WorkingDay OR w1:Weekend) AND w1.day.ordinalDay = pair[0] | |
MATCH (w2) | |
WHERE (w2:WorkingDay OR w2:Weekend) AND w2.day.ordinalDay = pair[1] | |
MERGE (w1)-[:NEXT]->(w2) | |
RETURN w1, w2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment