title: Firebase Firestore - unable to get the value of a field in a collection
body: <p>I have a Firebase Firestore defined as shown in the image
  <a href="https://i.stack.imgur.com/M1ikn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/M1ikn.png" alt="enter image description here"></a></p>
  
  <p>The field <strong><em>zaaidata</em></strong> is an object. I want to use the value of <strong><em>tot</em></strong> and <strong><em>van</em></strong> in a response that is sent to my chatbot in Dialogflow with a webhook.</p>
  
  <p>I managed to query the document, but I am unable to retrieve the specific values. I already tried this:</p>
  
  <ul>
  <li>doc.data["zaaidata"]["van"]</li>
  <li>doc.data("zaaidata")("van")</li>
  <li>doc.data.get("zaaidata")["van"]</li>
  </ul>
  
  <p>Here is my index.js</p>
  
  <pre><code>const functions = require('firebase-functions');
  const admin = require('firebase-admin');
  
  admin.initializeApp(functions.config().firebase);
  
  var db = admin.firestore();
  
  exports.webhook = functions.https.onRequest((req, res) =&gt; {
  
      let parameters = req.body.result.parameters; 
      var groentenRef = db.collection('groenten').doc(parameters.groente);
  
      var query = groentenRef.get()
          .then(doc =&gt; {
              if (!doc.exists) {
                  response = "No such document!";
              } else {
                  response = "Je kan zaaien tussen " + doc.data["zaaidata"]["van"] + " en " + doc.data["zaaidata"]["tot"];
              }
              res.setHeader('Content-Type', 'application/json'); 
              res.send(JSON.stringify({ "speech": response, "displayText": response}));
          })
          .catch(err =&gt; {
              console.log('Error getting documents', err);
          }); 
  });
  </code></pre>
  
  <p>Can someone help me on this, please? Thanks!</p>