Mongodb – Data does not update in UI without Reload
I have to update a quantity of product. I have update the data in database using put request but in UI the page need to reload to see the updated value. Here is my code const ItemDetail = () =>…
I have to update a quantity of product. I have update the data in database using put request but in UI the page need to reload to see the updated value. Here is my code const ItemDetail = () =>…
I am currently building a drawing app using React, Node and MongoDB. It saves images along with name and username in the database. When home page is opened, it has to retrieve and display the image on the screen. The…
I have this type of data on my server. [ { "brand": "Hyundai", "model": "Pickup -0395", "price": 80000 }, { "brand": "Hyundai", "model": "Sports Car -0305", "price": 70000 }, { "brand": "Tesla", "model": "Sports Car -05", "price": 180000 }, {…
app.put('/product/:id', async(req, res) =>{ const id = req.params.id; const updateQuantity = req.body; const filter = {_id: ObjectId(id)}; const options = { upsert: true}; const updateDoc = { $set: { productQuantity: updateQuantity.productQuantity } }; const result = await productCollection.updateOne(filter, updateDoc, options);…
I am trying to update a value in the UI. When I click to update, I have a button that will decrease by one In the database and be displayed in the UI's quantity section. when I click on the…
I have a question about cors implementation in django. Having a problem with setting the correct cors values. My deployment is on docker. I have a deployed 3 containers: backend: Django + DRF as backend (expose 8000 port) Nginx to…
I am new in backend development with MongoDB, NodeJS and frontend development with React-JS. I wanted to make an API endpoint that find the data from MongoDB and filter by user email address when user logged in the system. My…
I've got an React app, which calls internally: /api/* actions. In my case these actions are satisfied by NginX which loads relevant back-end code and returns JSON response. I would like this React app to be "self-served", I would like…
I am fetching some data from Mongodb. THe data is an array of objects. I would like to make the object with group.title === "unsubscribers" the last object in the array always. the array will always have variable length. I…
I was trying to setup two frontend react applications sharing a server written in nodejs. I tried setting up one frontend application it worked correctly but gets an error host not found in upstream "server" in /etc/nginx/conf.d/default.conf when i add…