var product = new Schema({
product: {type:Schema.Types.ObjectId, ref:'product'},
count: Number
});
var orderSchema = new Schema({
orderItems :[product],
});
var customerSchema = new Schema({
orders: [{type: Schema.Types.ObjectId, ref: 'orders'}],
});
I want to all the orders of a customer and all the items in each order.
Please guide me how can i populate it
Thanks