mongoose-smell-detector
v1.0.6
Published
A Mongoose Extention that would auto detect smells in your queries and warn you
Downloads
13
Readme
Mongoose Smell Detector
Enhance your MongoDB performance with mongoose-smell-detector, a tiny powerful tool designed to identify potentially unoptimized queries in your Node.js applications.
Features
- Automatically detects queries that might not be utilizing indexes
- Helps developers pinpoint performance bottlenecks in their codebase
- Easy integration with existing Mongoose projects
- Provides actionable insights to optimize database operations
Improve your application's efficiency and response times by catching slow queries before they impact your production environment.
Getting Started
Installation
NPM
npm i mongoose-smell-detector
Yarn
yarn add mongoose-smell-detector
Getting Started
All you need to do is import the package and call smellDetectorHook on post in your Mongoose Schema.
For Example -
const mongooseSmellDetector = require('mongoose-smell-detector')
const mongoose = require("mongoose");
const dataSchema = new mongoose.Schema({
...
})
rawDataSchema.post('find', mongooseSmellDetector.smellDetectorHook);
const MyModel = new mongoose.model("raw-data", dataSchema)
export default MyModel;
Please Note - This tool currently supports only find queries. Will add support for others very soon.
If you have any suggestions or feedback feel free to drop me an email on [email protected] or connect with me on linkedin