title: Mongoose | populate on post middleware for "save"
body: <p>Please consider the following <code>parentSchema</code> and <code>childSchema</code>:</p>
  <pre><code>const parentSchema = new mongoose.Schema({
      name: String,
      children: [{ type: mongoose.Schema.Types.ObjectId, ref: &quot;Child&quot; }],
  });
  
  const childSchema = new mongoose.Schema({
      name: String,
      parent: { type: mongoose.Schema.Types.ObjectId, ref: &quot;Parent&quot; },
  });
  </code></pre>
  <p>How do I access the name of the parent within a post middleware of the childSchema?
  I am trying the code below but <code>parent</code> is assigned the ObjectId instead of the actual parent model.</p>
  <pre><code>childSchema.post(&quot;save&quot;, async function (child) {
      const parent = child.populate(&quot;parent&quot;).parent;
  });
  </code></pre>
  <p>What's the right way to do this?</p>