You are using a non relational database and still thinking in a relational approach. Take a few steps back and figure out if you should really be using MongoDB for it.
As long as I know, in the NoSQL world you just store things directly in the document. For example, the document Student should be something like:
{
"type": "Student",
"name": "Jhon",
"email": "[email protected]",
"subjects_taken": ["calculus", "functional programming"]
}
The same goes for the Subject document.
{
"type": "Subject",
"name": "Calculus",
"taken_by": ["jhon", "alice"]
}
I used strings, but people often use the _id attribute to make the "relation".
Hope it clarifies.