title: Mongo db delete key from nested data
body: <p>Mongo database data  here i wants to delete key of report_data
  So i i will send key= ber2, report_name=Delete test, name=New folder it will delete only key ber2 from report_data of that report and folder</p>
  <pre><code>    {
          &quot;_id&quot; : ObjectId(&quot;6267b4554cbd527bee4c6b3a&quot;),
          &quot;structure&quot; : [
              {
                  &quot;name&quot; : &quot;New folder&quot;,
                  &quot;values&quot; : [
                      {
                          &quot;report_name&quot; : &quot;mixll&quot;,
                          &quot;report_heading&quot; : &quot;mixll&quot;,
                          &quot;background&quot; : &quot;#f0f2f5&quot;,
                          &quot;grid&quot; : false,
                          &quot;report_data&quot; : {
                              &quot;mixchch&quot; : {
                                  &quot;datasource&quot; : &quot;New_DGR&quot;,
                                  &quot;source&quot; : &quot;10&quot;,
                                  &quot;title&quot; : &quot;mix chch&quot;
                              }
                          },
                          &quot;unique_report_name&quot; : &quot;mixll&quot;
                      },
                      {
                          &quot;report_name&quot; : &quot;Delete test&quot;,
                          &quot;report_heading&quot; : &quot;Delete test&quot;,
                          &quot;background&quot; : &quot;#f0f2f5&quot;,
                          &quot;grid&quot; : false,
                          &quot;report_data&quot; : {
                              &quot;ber2&quot; : {
                                  &quot;data&quot; : null,
                                  &quot;datasource&quot; : &quot;Restest_0423&quot;,
                                  &quot;source&quot; : &quot;10&quot;,
                                  &quot;title&quot; : &quot;ber 2&quot;
                              },
                              &quot;piechart&quot; : {
                                  &quot;data&quot; : null,
                                  &quot;datasource&quot; : &quot;Restest_0423&quot;,
                                  &quot;source&quot; : &quot;10&quot;,
                                  &quot;title&quot; : &quot;pie chart&quot;
                              },
                              &quot;lnechart&quot; : {
                                  &quot;data&quot; : null,
                                  &quot;datasource&quot; : &quot;Restest_0423&quot;,
                                  &quot;source&quot; : &quot;10&quot;,
                                  &quot;title&quot; : &quot;lne chart&quot;
                              }
                          },
                          &quot;unique_report_name&quot; : &quot;Deletetest&quot;
                      },
                  ],
                  &quot;type&quot; : 1
              },
              {
                  &quot;name&quot; : &quot;newdkdd&quot;,
                  &quot;values&quot; : [
                      {
                          &quot;report_name&quot; : &quot;aldkkd&quot;,
                          &quot;report_heading&quot; : &quot;aldkkd&quot;,
                          &quot;background&quot; : &quot;#f0f2f5&quot;,
                          &quot;grid&quot; : false,
                          &quot;report_data&quot; : {
                              &quot;sslsls&quot; : {
                                  &quot;datasource&quot; : &quot;alias&quot;,
                                  &quot;source&quot; : &quot;3&quot;,
                                  &quot;title&quot; : &quot;sslsls&quot;
                              }
                          },
                          &quot;unique_report_name&quot; : &quot;aldkkd&quot;
                      }
                  ],
                  &quot;type&quot; : 1
              }
          ],
          &quot;unique_report_id&quot; : 986219
      }
  </code></pre>
  <p>Pymongo mongo query</p>
  <pre><code>mycol.update_one({
      &quot;structure.name&quot;: folder_name
      },
      {
      &quot;$pull&quot;: {
              &quot;structure.$[structure].values&quot;: {
              &quot;report_name&quot;: report_name,
          }
      }},
      array_filters= [
          {
              &quot;structure.name&quot;: folder_name
          }
      ],
  upsert=True)
  </code></pre>
  <p>I am using above query to delete it is deleting the entire report
  How can i delete only one key from the report_data key</p>
  <p>Please  take a look</p>