title: Pymongo query to extract value of a matching key
body: <p>I have below document:</p>
  <pre><code>{
      &quot;_id&quot;: &quot;61f7d5cfd0c32b744d3f81c2&quot;,
      &quot;_form&quot;: &quot;61e66b8fd0c32b744d3e24a0&quot;,
      &quot;_workflow&quot;: &quot;61e54fe2d0c32b744d3e0b7c&quot;,
      &quot;_appUser&quot;: &quot;61e6b098d0c32b744d3e3808&quot;,
      &quot;sectionResponse&quot;: [{
              &quot;_id&quot;: &quot;61f7d5cfd0c32b744d3f81c3&quot;,
              &quot;name&quot;: &quot;Project Details &amp; Goals&quot;,
              &quot;order&quot;: 2,
              &quot;fieldResponse&quot;: [{
                      &quot;_id&quot;: &quot;61f7d5cfd0c32b744d3f81c4&quot;,
                      &quot;fieldType&quot;: &quot;Text&quot;,
                      &quot;name&quot;: &quot;Project Name&quot;,
                      &quot;value&quot;: &quot;TRT&quot;,
                      &quot;order&quot;: 0
                  },
                  {
                      &quot;_id&quot;: &quot;61f7d5cfd0c32b744d3f81c5&quot;,
                      &quot;fieldType&quot;: &quot;Number&quot;,
                      &quot;name&quot;: &quot;Amount Requested&quot;,
                      &quot;value&quot;: &quot;20&quot;,
                      &quot;order&quot;: 1
                  },
                  {
                      &quot;_id&quot;: &quot;61f7d5cfd0c32b744d3f81c6&quot;,
                      &quot;fieldType&quot;: &quot;Number&quot;,
                      &quot;name&quot;: &quot;Project Cost&quot;,
                      &quot;value&quot;: &quot;50&quot;,
                      &quot;order&quot;: 1
                  },
                  {
                      &quot;_id&quot;: &quot;61f7d5cfd0c32b744d3f81c7&quot;,
                      &quot;fieldType&quot;: &quot;Comment&quot;,
                      &quot;name&quot;: &quot;Project Goals&quot;,
                      &quot;value&quot;: &quot;TRT&quot;,
                      &quot;order&quot;: 3
                  }
              ]
          },
          {
              &quot;_id&quot;: &quot;61f7d5cfd0c32b744d3f81c8&quot;,
              &quot;name&quot;: &quot;Section Heading&quot;,
              &quot;order&quot;: 2,
              &quot;fieldResponse&quot;: [{
                      &quot;_id&quot;: &quot;61f7d5cfd0c32b744d3f81c9&quot;,
                      &quot;fieldType&quot;: &quot;Multiselectdropdown&quot;,
                      &quot;name&quot;: &quot;Multiselectdropdown&quot;,
                      &quot;value&quot;: &quot;Y&quot;,
                      &quot;order&quot;: 0
                  },
                  {
                      &quot;_id&quot;: &quot;61f7d5cfd0c32b744d3f81ca&quot;,
                      &quot;fieldType&quot;: &quot;Image_Upload&quot;,
                      &quot;name&quot;: &quot;Image Upload&quot;,
                      &quot;value&quot;: &quot;Y&quot;,
                      &quot;order&quot;: 1
                  }
              ]
          }
      ],
      &quot;order&quot;: 2,
      &quot;status&quot;: &quot;Reviewed&quot;,
      &quot;updatedAt&quot;: &quot;2022-01-31T12:27:59.541Z&quot;,
      &quot;createdAt&quot;: &quot;2022-01-31T12:27:59.541Z&quot;,
      &quot;__v&quot;: 0
  }
  </code></pre>
  <p>Inside the document, there is a <code>sectionResponse</code> which contains response of multiple sections. Inside this, there is a <code>fieldResponse</code> which contains the <code>name</code> and <code>value</code>. I have to extract the value from all the documents where <code>name</code> is <code>Amount Requested</code>.</p>
  <p>Can anyone help me in writing a query for such situation. Please help. Thanks</p>