I am getting 'TypeError: Cannot call method 'path' of undefined' while doing nested populate in Mongoose

My category schema is:

var CategorySchema = new Schema({
  subcategories:[{type : Schema.ObjectId, ref : 'Category', null: true}],
  parent: {type : Schema.ObjectId, ref : 'Category', null: true},
  products:[{type : Schema.ObjectId, ref : 'Product'}]
})

When I try to make nested populate like below, I am getting "Cannot call method 'path' of undefined'

list: function (options, cb) {
    var criteria = options.criteria || {}
      , Category = this

    this.find(criteria)
      .populate('subcategories')
      .exec(function(err,docs){
        if(err){
          console.log(err.message);
          cb(err);
        }
        var opts = [
              { path: 'subcategories.products' }
        ];
        Category.populate(docs, opts, function(err, docs2) {
          if(err){
                cb(err);
          }          
          cb(docs2);
        })

     })
  }

Where am I wrong?

var opts = [
  { path: 'subcategories.products' }
];
Category.populate(docs, opts, function(err, docs2) {

subcategories.products is an unknown path for the Category schema so you'll need to change the model used for population. Either of the following two approaches will work:

// 1
var opts = [
  { path: 'subcategories.products' }
];
Product.populate(docs, opts, function(err, docs2) {

or

// 2
var opts = [
  { path: 'subcategories.products', model: 'Product' }
];
Category.populate(docs, opts, function(err, docs2) {