@haseebmernstack/clean-mongoose
v0.1.0
Published
Utility to clean Mongoose documents (convert _id to id, remove __v, remove private fields). TypeScript-ready.
Downloads
5
Maintainers
Readme
clean-mongoose
Tiny TypeScript utility to clean Mongoose documents and plain objects for safe API responses.
Features
- Convert
_id->id - Remove
__v - Optionally remove
passwordfields and underscore-prefixed fields - Works with arrays, nested objects, populated docs
- Zero dependencies, TypeScript types included
Install
npm install @haseeb/clean-mongoose
# or
yarn add @haseeb/clean-mongoose