title: Unsure how to model many-to-many relationship in MongoDB
body: <p>I'm new to MongoDB and I'm trying to model a Many to Many relationship into at least 2 collections (I need two collections for the project). What I'm having is a collection of universities, faculties and specializations, and another collection for students and their gradebook (this was the middle entity between specializations and students in SQL, not sure if it's needed in Mongo anymore). I tried to use <a href="https://markstarkman.com/blog/2011/09/15/mongodb-many-to-many-relationship-data-modeling/" rel="nofollow noreferrer">This</a> as an inspiration but it limits me as I can only search students by university id (I want for example to search students from a certain specialization or a certain faculty). I could put every row from university, faculty and specialization in the student collection and vice versa but I really don't think it's ideal. Here's what I have so far:</p>
  <pre><code>db.students.insertOne({_id:1, firstname: 'John', lastname: 'Silas', ethnicity:'english', civilstatus:'single', residence:'London', email:'johnSilas@gmail.com', gradebook:[{ year:2018, registrationyear:2017, formofeducation:'traditional'}], universities:[1]}) 
  </code></pre>
  <pre><code>db.universities.insertOne({_id:1, name:'University of London', city:'London', adress:'whatever', phone: 'whatever', email: 'whatever@gmail.com', faculty:[{name: 'Law', adress:'whatever', phone: 'whatever', email: 'whatever@gmail.com'}], specialization:[{name:'criminal rights', yearlytax:5000, duration: 3, level:'bachelordegree', language:'english'}], students: [1,2]}) 
  </code></pre>
  <p>I'm sorry if I don't understand basic noSQL concepts, I am new to it. Thanks in advance.</p>