xxxxxxxxxx
WITH range(1,12) as months
FOREACH(month IN months |
CREATE (m:Month {month: month})
FOREACH(day IN (CASE
WHEN month IN [1,3,5,7,8,10,12] THEN range(1,31) // these months have 31 days
WHEN month = 2 THEN range(1,28) // not working with years, so no leapyear calc, default Feb has 28 days
ELSE range(1,30) // all other months have 30 days
END) |
CREATE (d:Day {day: day})
MERGE (m)-[:HAS_DAY]->(d)))