title: Nested reference populate with mongoose and Nodejs
body: <p>I am over this for the last 2 hours and nothing worked or haven't found anything similar that uses an array to pass to populate.</p>
  <p>So I have a car schema that has a reference to a company. The schema is the below:</p>
  <pre><code>const carsSchema = new mongoose.Schema({
      plate: {type:String, required:true, unique: true},
      manufacturer: {type:String, required:true},
      model: {type:String, required:true},
      company: {type: mongoose.ObjectId,ref:&quot;Company&quot;,required:true},
      }, {
          timestamp : true,
  });
  </code></pre>
  <p>I also have a CarCheckSchema that is the below and also has the car model as reference:</p>
  <pre><code>const carCheckSchema = new mongoose.Schema({
      car: {type: mongoose.ObjectId,ref:&quot;Car&quot;,required:true},
      condition: {type:String, required:true},
      conditionComments: {type:String},
      carCheckedStatus: {type:Boolean, default:false},
      }, {
          timestamp : true,
  });
  </code></pre>
  <p>In the CarCheck controller in order to populate multiple items I use an array that I pass what I want to populate:</p>
  <pre><code>const populateQuery = [
                                  {path: &quot;company&quot;, select: [&quot;name&quot;]},
                                  {path: &quot;car&quot;, select: [&quot;plate&quot;, &quot;manufacturer&quot;, &quot;model&quot;]}
                                  ]
  
  const carCheck = await CarCheck.findById(req.params.id).populate(populateQuery);
  </code></pre>
  <p>Is there a way instead calling the &quot;company&quot; model separately, to get the nested &quot;company&quot; model reference that the &quot;car&quot; model includes already?
  Sorry if this is a duplicate but couldn't find something similar that passes an array to the populate function.
  Thank you in advance.</p>