title: How would I reference my question model in Mongoose and Express
body: <p>I would like to reference my Question model text which is referenced in the Survey model. I am able to get the ID of the question but I cannot get the QuestionText if I write</p>
  <pre><code>SurveyList[count].Questions.QuestionText
  </code></pre>
  <p>This works:</p>
  <pre><code>SurveyList[count].Questions._id
  </code></pre>
  <p>Full code for front end:</p>
  <pre><code>&lt;!-- All Surveys --&gt;
  &lt;% for (let count = 0; count &lt; SurveyList.length; count++) { %&gt;
      &lt;tr&gt;
      &lt;!-- Display title --&gt;
          &lt;td class=&quot;text-center text-white&quot;&gt;&lt;%= SurveyList[count].Title %&gt;&lt;/td&gt;
          &lt;!-- Display type --&gt;
          &lt;td class=&quot;text-center text-white&quot;&gt;&lt;%= SurveyList[count].Type %&gt;&lt;/td&gt;
          &lt;td class=&quot;text-center text-white&quot;&gt;&lt;%= SurveyList[count].Questions._id %&gt;&lt;/td&gt;
  &lt;% } %&gt;
  </code></pre>
  <p>My Question Model Schema:</p>
  <pre><code>// create a question model
  let questionModel = mongoose.Schema(
    {
      
        QuestionText: String,
        Options: String,
     
    },
    {
      collection: &quot;questions&quot;,
    }
  );
  </code></pre>
  <p>My Survey model schema:</p>
  <pre><code>let surveyModel = mongoose.Schema(
    {
      Title: String,
      Type: [String],
      Questions: { type: mongoose.Schema.Types.ObjectId, ref: &quot;questions&quot; },
      Answered: { type: Number, default: 0 }, // how many times users answered
      DateCreated: { type: Date, default: Date.now }, // date created
      Lifetime: { type: Date, default: Date.now }, // Survey expiry
    },
    {
      collection: &quot;surveys&quot;,
    }
  );
  </code></pre>
  <p>Controller:</p>
  <pre><code>module.exports.displayLiveSurveys = (req, res, next) =&gt; {
    Survey.find((err, surveyList) =&gt; {
      if (err) {
        return console.error(err);
      } else {
        
        res.render(&quot;content/survey/live-surveys&quot;, {
          title: &quot;Live Surveys&quot;,
          page: &quot;live-surveys&quot;,
          username: req.user ? req.user.username : &quot;&quot;,
          SurveyList: surveyList,
        });
      
      
      }
    });
  };
  </code></pre>
  <p>If there is a way to reference Question.find inside Survey.find and add QuestionList to res.render that might work too? I tried that with no luck.</p>
  <p>Survey Payload:</p>
  <pre><code>{
      &quot;_id&quot;: {
          &quot;$oid&quot;: &quot;60fd0c7ecd479a846f1f0fe5&quot;
      },
      &quot;Type&quot;: [&quot;TF&quot;],
      &quot;Answered&quot;: {
          &quot;$numberInt&quot;: &quot;0&quot;
      },
      &quot;Title&quot;: &quot;hello&quot;,
      &quot;Questions&quot;: {
          &quot;$oid&quot;: &quot;60fd067d736566143839e3fd&quot;
      },
      &quot;DateCreated&quot;: {
          &quot;$date&quot;: {
              &quot;$numberLong&quot;: &quot;1627195005136&quot;
          }
      },
      &quot;Lifetime&quot;: {
          &quot;$date&quot;: {
              &quot;$numberLong&quot;: &quot;1627195005136&quot;
          }
      },
      &quot;__v&quot;: {
          &quot;$numberInt&quot;: &quot;0&quot;
      }
  }
  </code></pre>
  <p>Question Payload:</p>
  <pre><code>{
      &quot;_id&quot;: {
          &quot;$oid&quot;: &quot;60fd0cbacd479a846f1f0fe6&quot;
      },
      &quot;QuestionText&quot;: &quot;test&quot;,
      &quot;Options&quot;: &quot;tester&quot;,
      &quot;__v&quot;: {
          &quot;$numberInt&quot;: &quot;0&quot;
      }
  }
  </code></pre>