title: Can't fill array with firestore data
body: <p>I'm trying to build a Firestore web app. I configured my database etc... And everything is right.
  But I'm now trying to get data from the firebase, store it in a variable (or fill array with those data) and do my computation on this variable that I will update every 30 sec (I do this to limit the number of query). </p>
  
  <p>I can access to the data and read them without any problem but I can't add them. I've tried to put the variable in global, pass it through the function as argument but nothing works. </p>
  
  <p>Here is my code: </p>
  
  <pre><code>userArray = [];
  
  db.collection("scenario-name").get().then(function(querySnapshot) {
        querySnapshot.forEach(function(doc) {
            userArray.push(doc.id);
        });
  });
  
  
  console.log(userArray);
  </code></pre>
  
  <p>But I got something like this : </p>
  
  <p><a href="https://ibb.co/j3YdfLj" rel="nofollow noreferrer">https://ibb.co/j3YdfLj</a></p>
  
  <p>I also tried the .push.apply, or to define a function and pass userArray in it or even to do this kind of stuff : </p>
  
  <pre><code>userArray = [];
  
  db.collection("scenario-name").get().then(function(querySnapshot) {
        querySnapshot.forEach(function(doc) {
            apply(doc);
        });
  });
  
  function apply(doc){
      userArray.push(doc.id);
  }
  </code></pre>
  
  <p>Can I store a firestore query querying the whole document and work on it? Or should I do a query for every stuff? How can I store in a variable? </p>
  
  <p>Thank you!</p>