I am trying to create a relationship between the below path where all nodes have a date property to other nodes present in my Graph DB with rest of the dates like '2021-05-01' , '2021-06-01' ,,'2021-07-01'etc. but the relationship should be created where every month date is connected to the next month date
I have written this query : Match (a:Storage),(b:Storage)
This works fine and creates the relation between all nodes but I just want to create relation between the nodes shown in the picture to just their next month i.e in the picture date is '2021-04-01' (but it can be any date) so it should be connected to nodes with date '2021-05-01' only and not connected further to '2021-06-01'. I want to limit my relationship creation. Is it possible ? And how to achieve it .
This is the Output that I want