How to use mongodb or mongoose library to create document references

  mongodb, question

For example, a student (student number, name, gender, age) teacher (staff number, name) course selection information (student number, course number, staff number, grade)

How can I use mongodb module to establish the relationship among these three? ?

MongoDB creates index: db.collection.createindex ({name: 1})
Db-is a database
Collection-is table (relative to mysql)

Regarding the establishment of the database, I will write as follows: (for reference only)
student
{
_id:ObjectID(<MongoDB ID>),
Id: < student number >,
Gender: < gender >,
Age: < age >,
Name: < name >,
course_ids:[

course_id1:{
 Mark: < results >,
 Teacher_id: < staff number >
 },
 course_id2:{
 Mark: < results >
 }

]
}

teacher
{
_id:ObjectID(<MongoDB ID>),
Id: < staff number >,
Name: < name >,
courses:[ course_id1, course_id2 ]
}

course
{
_id:ObjectID(<MongoDB ID>),
Id: < course number >
}