How to handle dates in neo4j

后端 未结 4 1135
眼角桃花
眼角桃花 2020-12-15 20:28

I\'m an historian of medieval history and I\'m trying to code networks between kings, dukes, popes etc. over a period of time of about 50 years (from 1220 to 1270) in mediev

4条回答
  •  抹茶落季
    2020-12-15 21:10

    As of Neo4J 3.4, the system handles duration and dates, see the official documentation. See more examples here.

    An example related to the original question: Retrieve the historical events that happened in the last 30 days from now :

    WITH duration({days: 30}) AS duration
    MATCH (h:HistoricEvent)
    WHERE date() - duration < date(h.date)
    RETURN h
    

提交回复
热议问题