@ghadautopia/express-profiler-mongoose
v1.0.0
Published
Mongoose scope for Ghada Express Profiler
Readme
Ghada Express Profiler Mongoose Scope
Mongoose scope for Ghada Express Profiler
Works with
@ghadautopia/express-profilerversion1
Dependencies
"@ghadautopia/express-profiler": "^1.0.0",
"ejs": "^3.1.6",
"on-finished": "^2.3.0"Installation
Using npm
npm install @ghadautopia/express-profiler-mongooseOr using yarn
yarn add @ghadautopia/express-profiler-mongooseUsage
Import mongooseScope and mongooseStreamMiddleware from @ghadautopia/express-profiler-mongoose and add them to Ghada Express Profiler configuration. As shown in the example below:
// import mongoose
const mongoose = require('mongoose');
// import mongooseScope instance and mongooseStreamMiddleware
const { mongooseScope, mongooseStreamMiddleware } = require('@ghadautopia/express-profiler-mongoose');
/**
* during profiler inistantiation,
* pass mongooseScope in the scopes array,
* pass mongooseStreamMiddleware in streamMiddlewares array and pass your mongoose instance to it
*/
profiler(app, {
scopes: [
...
mongooseScope,
...
],
streamMiddlewares: [
...
mongooseStreamMiddleware(mongoose)
...
],
});How it works
mongooseStreamMiddleware is used by mongoose scope stream to log data of each mongoose query/command
mongooseScope is used for rendering mongoose slot in the toolbar and the mongoose scope view


License
MIT
