title: Mongoose populate not working for nested object
body: <h3>Client.js</h3>
  <pre><code>const mongoose = require(&quot;mongoose&quot;);
  var Schema = mongoose.Schema;
  const clientSchema = new mongoose.Schema(
      {
          name: { type: String, required: true, default: &quot;&quot; },
      }, {
          timestamps: true
      }
  );
  module.exports = mongoose.model(&quot;Client&quot;, clientSchema);
  </code></pre>
  <h3>User.js</h3>
  <pre><code>const mongoose = require(&quot;mongoose&quot;);
  var Schema = mongoose.Schema;
  const userSchema = new mongoose.Schema({
          name: { type: String, required: true, default: &quot;&quot; },
          clients: [{
                  client: {
                      type: Schema.Types.ObjectId,
                      ref: &quot;Client&quot;,
                      default: null
                  },
                  user_group: {
                      type: Number
                      default: null
                  }
              }]
      }, { timestamps: true });
  module.exports = mongoose.model(&quot;User&quot;, userSchema);
  
  </code></pre>
  <h3>auth.js (Where trying to populate Clients)</h3>
  <pre><code>const express = require(&quot;express&quot;);
  const router = express.Router();
  const User = require(&quot;../models/User&quot;);
  const Client = require(&quot;../models/Client&quot;);
  router.post(&quot;/users&quot;, (req, res) =&gt; {
      let params = req.body;
      let total_client = [];
      User.findOne({
          email: params.email
      })
      .populate({
           path: &quot;clients.client&quot;,
           model: Client
        })
        .exec((err, user) =&gt; {
            console.log(user);
            res.send(user);
         });
  });
  module.exports = router;
  
  </code></pre>
  <p>Please check the above code. I have given code examples of my two models user.js and client.js. In user schema, I have referenced client inside an array object. While querying user, the client is not population. Please help me to get this thing done. Thanks in advance.</p>