'My web server connected to mongoDB is not responding
I'm new to node.js
I am making a web server connected mongoDB after watching this tutorial.
I am testing my web server using postman, response.send indicating success or not is output normally, but my mongoDB is unchanged
How it works is https:///player-data/ as in the tutorial
What do I need to fix?
// We create a POST route
app.post("/player-data/update-coins/:id", async (request, response) => {
// We use a mongoose method to find A record and update!
await playerModel.findOneAndUpdate(
{ userID: `${request.params.id}` },
{ $set: { coins: request.body.coins } }
// We set the coins to the coins we received in the body of the request
);
response.send("Updated Database.");
// Just a response.
});
https://cdn.discordapp.com/attachments/895868604476702791/945579168517750864/unknown.png https://cdn.discordapp.com/attachments/895868604476702791/945579769662169118/unknown.png https://cdn.discordapp.com/attachments/895868604476702791/945579858631741460/unknown.png
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
