How to insert document or fields in nested documents in mongo
<p>I want collection named systems under which there is a document named sub_systems and under which there are three documents named high mid &amp; low. And each high, mid and low contains separate multiple documents Like below</p>

<pre><code>systems: {
           sub_system_1 : {
                            high :{ {task1},
                                    {task2},
                                    .......
                                  },                                
                            mid  :{ {task1},
                                    {task2},
                                    .......
                                  },
                            low :{ {task1},
                                    {task2},
                                    .......
                                  },
                          },
           sub_system_2 : {
                            high :{ {task1},
                                    {task2},
                                    .......
                                  },                                
                            mid  :{ {task1},
                                    {task2},
                                    .......
                                  },
                            low :{ {task1},
                                    {task2},
                                    .......
                                  },
                          },
           ............
         }
</code></pre>

<p>So following are the questions I'm having
1. How will I create such nested document.
2. How will I insert new sub_system in the systems collection.
3. How will I insert new priority (high, mid, low) under sub_system document.
4. How will I insert new task in a specific sub_system and  under a specific priority(high,low, mid) document</p>

<p>I want to know this using mongo shell and also with perl mongodb</p>