Closed parteekcoder closed 1 year ago
@llaske this error persist due to these lines
query['_id'] = {
$in: req.user.classrooms.map(function(id) {
return new mongo.ObjectID(id);
})
};
query['_id'] = {
$in: req.user.students.map(function(id) {
return new mongo.ObjectID(id);
})
};
and etc.
Sorry it's impossible to reproduce your issue. It's probably because you're environment is incorrect or patched by your hand. We can't help you without a clear path to reproduce the issue from a standard environment.
I just simple cloned the repo then installed the dependencies and ran the server this my teacher object in database
Can you please once explain how req.user.students
is defined as we are not passing it from the frontend
Can you please explain the steps you followed
A teacher should be created with valid classrooms. If you create a teacher with Sugarizer Server dashboard, then it is created with classroom. Did you create this object manually?
yes
That explains why your object has some keys missing. It's better to create these objects from the dashboard.
Reproduce