var CartSchema = new Schema ({
productId: {type: Schema.Types.ObjectId, ref: "M_Data_Product", default: null},
qty: {type: Number, default: 0},
price: {type: Float, default: 0},
});
This is my shopping cart model.
var ProductSchema = new Schema({
name: {type: String, default: null},
categoryId: {type: Schema.Types.ObjectId, ref: "M_Data_Category", default: null}
});
This is the Product model I have created.
I am looking to retrieve cart records based on a specific categoryId. Any suggestions on how to achieve this?