title: How to get elements in array flask
body: <p>I'm doing a flask application. I need to get the elements of the session that are inside an array in mongodb.
  I tried to do everything, but I was unsuccessful.</p>
  <p>I need to get the 'password' inside 'contatos'.
  To do a validation within my application.
  I know that if you do the following code: <code>print(session['company'].Get(&quot;contatos&quot;))</code>, it shows all the content of the object, but I can't access the elements inside that object.</p>
  <pre class="lang-py prettyprint-override"><code>    {
      &quot;nome&quot;: &quot;Empresa Teste&quot;,
      &quot;cnpj&quot;: &quot;00.000.000/0001-00&quot;,
      &quot;endereco&quot;: {
          &quot;endereco&quot;: &quot;Rua, 1&quot;,
          &quot;cidade&quot;: &quot;Cidade Teste&quot;,
          &quot;estado&quot;: &quot;Estado Teste&quot;,
          &quot;uf&quot;: &quot;AA&quot;
      },
      &quot;idMatriz&quot;: 1,
      &quot;dtCadastro&quot;: &quot;01/01/2020&quot;,
      &quot;plano&quot;: {
          &quot;id&quot;: 1,
          &quot;nome&quot;: &quot;Plano de Teste&quot;,
          &quot;validade&quot;: &quot;01/01/2020&quot;
      },
      &quot;contatos&quot;: [{
          &quot;nome&quot;: &quot;Fabio&quot;,
          &quot;email&quot;: &quot;Teste&quot;,
          &quot;password&quot;: &quot;pass&quot;,
          &quot;telefone&quot;: &quot;Teste&quot;
      }],
      &quot;contasCadastradas &quot;: [{
          &quot;concessionaria&quot;: {
              &quot;id&quot;: 1,
              &quot;nome&quot;: &quot;EnelSP&quot;
          },
          &quot;identificador&quot;: &quot;Numero da Instalacao&quot;,
          &quot;cronogramaBusca&quot;: {
              &quot;inicio&quot;: 1,
              &quot;vencimento&quot;: 1,
              &quot;fim&quot;: 1
          },
          &quot;metodosCaptura&quot;: [{
              &quot;tipoCaptura&quot;: &quot;site&quot;,
              &quot;ordem&quot;: 1,
              &quot;usuario&quot;: &quot;user&quot;,
              &quot;senha&quot;: &quot;pwd&quot;,
              &quot;destino&quot;: &quot;endereco do site&quot;
          }, {
              &quot;tipoCaptura&quot;: &quot;email&quot;,
              &quot;ordem&quot;: 2,
              &quot;usuario&quot;: &quot;user&quot;,
              &quot;senha&quot;: &quot;pwd&quot;,
              &quot;destino&quot;: &quot;&quot;
          }]
      }, {
          &quot;concessionaria&quot;: {
              &quot;id&quot;: 2,
              &quot;nome&quot;: &quot;TIM&quot;
          },
          &quot;identificador&quot;: &quot;Numero da Instalacao&quot;,
          &quot;cronogramaBusca&quot;: {
              &quot;inicio&quot;: 1,
              &quot;vencimento&quot;: 1,
              &quot;fim&quot;: 1
          },
          &quot;metodosCaptura   &quot;: [{
              &quot;tipoCaptura&quot;: &quot;site&quot;,
              &quot;ordem&quot;: 1,
              &quot;usuario&quot;: &quot;user&quot;,
              &quot;senha&quot;: &quot;pwd&quot;,
              &quot;destino&quot;: &quot;endereco do site&quot;
          }, {
              &quot;tipoCaptura&quot;: &quot;email&quot;,
              &quot;ordem&quot;: 2,
              &quot;usuario&quot;: &quot;user&quot;,
              &quot;senha&quot;: &quot;pwd&quot;,
              &quot;destino&quot;: &quot;&quot;
          }]
      }]
  }
  </code></pre>
  <p>can you help me?</p>