How do i create a Date Range

Hi i want to add a date range for a student enrollment ie. if someone enroles in sep22 and enrolment ends23. i also need to set a date for when a course starts and finishes. Im new to Mongo and really not sure on how to add this…
i have three collections. student, course and lecturer.

Hi @Jean_Smith

I’m not sure what you really need here. Do you want to set a parameter so that someone cannot enroll beyond a certain date? That sounds like something that’s easier to enforce in the application side rather than the database side. It’s better for testing too, since you can write tests for your code that ensures that it behaves as expected with no corner cases.

However if you need help with MongoDB in particular (queries, design, etc.), could you post some example documents, the desired outcome, and your attempts so far?

Best regards
Kevin