skip to Main Content

Error — Cast to Number failed for value "NaN" (type number) at path "totalOrders" – Javascript

I created an API for my project but in an endpoint, there occurred an error that I couldn't fix. const fullOrdersForService = service.totalOrders const updatedFullOrdersForService = fullOrdersForService + 1 const updateService = await Service.findOneAndUpdate({_id:serviceId}, { totalOrders: updatedFullOrdersForService },{new:true}) Absolutely in…

VIEW QUESTION
Back To Top
Search