Shah Project
Shah Project
Collection: school
{"_id": 1,
"name": "School1",
}
Collection: teacher
"_id": 1,
"teacher_name": “shah",
"temail": "[email protected]",
"teacher_phone": "123-456-7890",
"dob": "1990-01-01",
"school_id": 1
Collection: student
"_id": 1,
"sname": "Student1",
"semail": "[email protected]",
"dob": "2000-01-01",
"school_id": 1
Collection: class
"_id": 1,
"cname": "Class1",
"cyear": "2023-01-01",
"school_id": 1
Collection: subject
"_id": 1,
"sname": "Subject1",
"teacher_id": 1
Collection: enrollment
"_id": 1,
"sid": 1,
"cid": 1
Collection: exam
"_id": 1,
"cid": 1,
"Date": "2023-01-01",
"ename": "Exam1"
}
Collection: attendance
"_id": 1,
"sid": 1,
"cid": 1,
"Date": "2023-01-01",
"status": "P"
Querying:
Querying for all documents in a collection:
Find all the documents in the school collection.
db.school.find();
Update:
Delete:
Delete by Criteria:
Delete all enrollment records for Student1.
db.enrollment.deleteMany({ "sid": 1 });
Delete all attendance records for a specific date.
db.attendance.deleteMany({ "Date": "2023-01-01" });