---
title: "Discussion on \"PATCH request gives 200 but not updating database (MongoDB)\" | Hashnode"
description: "Discussion on \"PATCH request gives 200 but not updating database (MongoDB)\". I spent hours debugging a PATCH request that looked perfect but was not updating the database. this is the code\napp.patch(async (req, res) => {\n    let user = await User.findById(req.params.id);\n    i"
url: "https://hashnode.com/posts/patch-request-gives-200-but-not-mongodb/69c2d0a492029d915f5f54e1"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [PATCH request gives 200 but not updating database (MongoDB)](https://nodejs-learnings.hashnode.dev/patch-request-gives-200-but-not-mongodb?utm_source=hashnode&utm_medium=feed)

I spent hours debugging a PATCH request that looked perfect but was not updating the database. this is the code app.patch(async (req, res) => { let user = await User.findById(req.params.id); i

Mar 24 · 2 min read · nodejs-learnings.hashnode.dev  
Read the article

## Written by

[Aman Shahi](https://hashnode.com/@TheBinaryCoder)

@TheBinaryCoder

  
[View profile](https://hashnode.com/@TheBinaryCoder)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
