Have ideas to improve npm?Join in the discussion! »

mongoose-explain

0.2.2 • Public • Published

mongoose-explain

Log mongoose .explain() output for your mongoose .find(), .findOne(), and .aggregate() calls to the console

Example

var mongoose = require('mongoose');
var explain = require('mongoose-explain');
 
var schema = new Schema({
  title: String,
  author: String,
  options: String
});
 
schema.plugin(explain);
 
var Author = mongoose.model('Author', schema, 'author');
 
// Logs `[{ queryPlanner: [Object], executionStats: [Object], serverInfo[Object] }]`
// on MongoDB 3.0.
// See https://docs.mongodb.com/manual/reference/explain-results/
Author.find({ title: 'Professional AngularJS' }, function(err, res) {});

Keywords

none

Install

npm i mongoose-explain

DownloadsWeekly Downloads

2,414

Version

0.2.2

License

Apache 2.0

Unpacked Size

17.1 kB

Total Files

6

Last publish

Collaborators

  • avatar