react state showing old data after mongodb was re downloaded and reconnected

Viewed 21

I'm working on a project where I'm using reactjs in my frontend and nodejs with mongodb in my backend. My computer recently restarted, and I had trouble reconnecting to mongodb. I ended up updating monogodb, re downloading it, and finally, reconnecting and restarting it. The issue from there was that all of my previous database collections where gone. Currently, I'm having an issue where old data that no longer is being stored nor shown in mongodb is affecting the working of my project and being shown in the developer tools. For example: In my old collection, I had a product that was $50 dollars, however, I don't currently have a product with that same price yet when I try to make a return (which isn't working because of this issue) in the developer tools it shows:

image: "/uploads/2022-04-05T04:39:38.449Zproduct-1.jpg"
name: "sample name 1649133566290"
price: 50
product: "624bc7fe0f91078261ab6529"
profit: 10
qty: 2
_id: "624bc7fe0f91078261ab6529"

The product that I was trying to return has price: 10 and qty: 1. The name also isn't the same nor is the profit nor are the product and _id. Does anyone know why this is happening or how to fix this? I would really appreciate any help with this.

0 Answers
Related