I want to populate productId and distributor. following is the array in my schema:
products: [
{
productId: {
type: String,
required: true,
ref: 'companyProduct'
},
quantity: {
type: String,
required: true,
},
distributor: {
type: String,
required: true,
ref: 'distributor'
}
}
],