this is my bill schema
{
customerName: { type: String },
customerPhone: { type: Number },
billMRPTotal: { type: Number },
billAmountTotal: { type: Number },
billDiscountTotal: { type: Number },
billPercentageDiscountTotal: { type: Number },
totalNumberOfUniqueItems: { type: Number },
totalNumberOfItems: { type: Number },
items: [
{
itemDetail: {
type: Schema.Types.ObjectId,
ref: "Item",
},
itemQuantityInBill: { type: Number },
itemMRPtotal: { type: Number },
itemDiscountTotal: { type: Number },
itemSellingPriceTotal: { type: Number },
},
],
createdAt: { type: Date, default: Date.now },
},
{
timestamps: true,
}
);
and i want to update all the things in this schema…like if I added new items or if I changed the item quality bill.
I am getting the changed state of data perfectly fine but whenever I am using the findIdByUpadte method in Model it’s not updating that model.