---
title: "Discussion on \"How to delete/hide properties of Mongoose object - Node.js\" | Hashnode"
description: "Discussion on \"How to delete/hide properties of Mongoose object - Node.js\". The solution for this is to define a custom .toJSON() method on the Mongoose schema and delete the properties which you want to hide in the response."
url: "https://hashnode.com/posts/how-to-deletehide-properties-of-mongoose-object-nodejs/6146f7abe1f56817e3607c67"
---

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

Discussion

# [How to delete/hide properties of Mongoose object - Node.js](https://saiphani.hashnode.dev/how-to-deletehide-properties-of-mongoose-object-nodejs?utm_source=hashnode&utm_medium=feed)

The solution for this is to define a custom .toJSON() method on the Mongoose schema and delete the properties which you want to hide in the response.

Sep 19, 2021 · 2 min read · saiphani.hashnode.dev  
Read the article

-   [#nodejs](https://hashnode.com/tag/nodejs)
-   [#backend](https://hashnode.com/tag/backend)
-   [#mongodb](https://hashnode.com/tag/mongodb)
-   [#mongoose](https://hashnode.com/tag/mongoose)
-   [#javascript](https://hashnode.com/tag/javascript)

## Written by

[Sai Phani Krishna Pasumarthi](https://hashnode.com/@saiphani)

@saiphani · Hyderabad, Telangana, India

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

Software Developer at Microsoft | Tech Enthusiast | Java | JavaScript | Full Stack Dev

I am a Full Stack Software Developer working at Microsoft.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
