In mongodb(pymongo) how could i create only the missing path in a nested document
Im using django and mongoDB connected by Pymongo.
And i made a collection of users that inside each user there are details, and a calender when the user first register the calendar is an empty array(could be changed if needed), in the calendar would be a list of years, inside every year a list of months, inside every month would be a list of days, and in every day a list of events.
And i need that when a user wants to add an event to a specific date it would add it to the correct path meaning if the specified year allready exists it would insert the event in it and so on for the month and day.
But if the year isnt exist yet it would create the needed path.