const CourseSchema = new Schema({
course_name: {
type: String,
trim: true,
},
Course_Runs: [
{
run_id: {
type: String,
},
// This field is for Teachers that are involved in the course run
teachers: [{ type: Schema.Types.ObjectId, ref: "users" }],
// Course Date Duration will be an inferred field from first session and last session
Sessions: [{
session_start_datetime: {
type: Date,
},
session_end_datetime: {
type: Date,
},
]
}]
}
Above is a snippet of the Schema
I want to be able to get documents where ALL Sessions object has a session_start_datetime greater than a specified date such as current date.