title: How can I insert a new entry inside Multilevel structure of mongoDB database?
body: <p>I am working on an app that contain details of an academic year in Multilevel structure of mongoDB database.</p>
  
  <p>For this I've created structure like this:</p>
  
  <pre><code>[
  {
          "_id" : ObjectId("5a1519a71fe8cc4df5888ff5"),
          "academicyear" : "2016-2017",
          "departments" : [
                  {
                          "deptname" : "computer",
                          "semesters" : [
                                  {
                                          "sem" : "2",
                                          "classes" : [
                                                  {
                                                          "class" : "1",
                                                          "theory" : [
                                                                  {
                                                                          "subname" : "DS",
                                                                          "faculty" : [
                                                                                  {
                                                                                          "facultyname" : "KSS",
                                                                                          "facultydept" : "COMP"
                                                                                  }
                                                                          ]
                                                                  }
                                                          ],
                                                          "practical" : [
                                                                  {
                                                                          "subname" : "DS",
                                                                          "batch" : [
                                                                                  {
                                                                                          "bname" : "C",
                                                                                          "facultyname" : "KSS",
                                                                                          "facultydept" : "COMP"
                                                                                  }
                                                                          ]
                                                                  }
                                                          ]
                                                  }
                                          ]
                                  }
                          ]
                  }
          ]
  }
  
  
  ]
  </code></pre>
  
  <p>Now for the same academic year and for the same department I would like to create a new semester node inside the array of semesters. For that I've tried syntax of $ and use of . operator but it did not worked well. How can I add a new semester node inside that semesters array? Also after creating a new semester node, how can I add a new class in an classes array?</p>