title: Access specific data on Json - NodeJS
body: <p>I'm trying to access data from a json but i can't... I have tried some explanations i found on the internet, but i guess there is something wrong on my code.</p>
  <p>I'm getting data from a sql server database using the following code:</p>
  <pre><code>async function getLogin1(Operador, Senha) { 
      try {
          let pool = await sql.connect(config);
          let getLogin1 = await pool.request()
              .input('input_parameter', sql.VarChar, Operador)
              .input('input_parameter1', sql.VarChar, Senha)
              .query(&quot;SELECT Codigo, Operador, Senha FROM Usuario where Operador = @input_parameter and Senha = @input_parameter1&quot;);
          return getLogin1.recordsets;
      }
      catch (error) {
          console.log(error);
  
      }
  }
  
  </code></pre>
  <p>So i get the recordsets here and put in a json:</p>
  <pre><code>router.route(&quot;/Login1&quot;).get((request, response) =&gt; {
      console.log(request.body.operador);
      console.log(request.body.senha);
      Operador = request.body.operador;
      Senha = request.body.senha;
  
      dboperations.getLogin1(Operador, Senha).then(result =&gt; {
          console.log(Operador, Senha);
          response.json(result);
          var json = JSON.stringify(result);
          console.log(json);
      })
  
  })
  
  </code></pre>
  <p>On the console it shows the json:</p>
  <pre><code>[[{&quot;Codigo&quot;:1,&quot;Operador&quot;:&quot;Username&quot;,&quot;Senha&quot;:&quot;123456&quot;}]]
  </code></pre>
  <p>I would like to get the individual data (codigo, operador and senha) to put in a individual string each one, but i cant access the data.
  When I try like json[0] for example i get all the json (because my json has every info on the first position i guess), and when i try json.Codigo (for example) i get a &quot;undefined&quot; error.</p>
  <p>What am i doing wrong and what the best way to solve?</p>
  <p>And sorry for the low knowledge, this is my very first api.</p>
  <p>(And yes, this is a login code and its not the best way to treat user data but its a very small system for intern use)</p>