title: The array gets cleared after mongoose.findOne()
body: <p>I am trying to get documents out of the database (questions) and store them in an array for further use (The questions would be asked to the players). </p>
  
  <p>However, when I call findOne(), and add it's result to an array, the array is empty after the callback.. Even though it contains the data in there!</p>
  
  <pre><code>private Questions: iGeneralQuestion[];    
  
  private LoadQuestions(): iGeneralQuestion[] {
          const result: iGeneralQuestion[] = [];
          for (let qid of this.GeneralArguments.questionIds) {
            QuestionModel.findOne({ id: qid }, (err: any, question: any) =&gt; {
              if (err) return err;
              if (!question) return question;
              this.Questions.push({
                questionId: question.id,
                question: question.question,
                answer: question.answer,
                otherOptions: question.otherOptions,
                timeLimit: question.timeLimit,
                difficulty: question.difficulty
                //explanation: question.explanation
                //pictureId: question.pictureId
              });
              console.log(this.Questions); //The array is full here! (Gets filled with each iteration)
            });
          }
          console.log(this.Questions); //But it doesn't contain anything here!
          return result;
        } 
  </code></pre>
  
  <p>This is the code that loads the documents, and saves their content in the array.</p>
  
  <p>I have tried using the promise functions and find() instead of findOne().. To no avail!</p>
  
  <p>I'm absolutely lost with this, as it shouldn't be about some kind of scope error. The Questions array is a field variable, but it seems to get cleared in the end.</p>
  
  <p>Any help is appreciated!</p>