I am trying to use mongoose populate function but in response I am getting empty array, I have seen multiple posts regarding this
var MerchantSchema = new mongo
Make sure that packages array in Merchant schema contains ObjectIds of type string, (not number). You can ensure this with something like:
merchant.packages.map(r => { r._id = r._id + ''; });