diff --git a/lib/cache.js b/lib/cache.js index 39501bf..c9c5da6 100644 --- a/lib/cache.js +++ b/lib/cache.js @@ -10,8 +10,8 @@ exports.install = module.exports.install = function(mongoose, options) { exec: mongoose.Query.prototype.exec }; - mongoose.Query.prototype.cache = function() { - this.__cached = true; + mongoose.Query.prototype.cache = function(enabled) { + this.__cached = enabled === false ? false : true; return this; };