Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,8 @@ db.User.find({ ... }).cache().exec(function() { ... })
```

For more talky output add ```debug: true``` to the cacheOpts.

For getting the lru cache object in order to have access to its API
```javascript
mongoose.getCache()
```
3 changes: 3 additions & 0 deletions lib/cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ exports.install = module.exports.install = function(mongoose, options, Aggregate
mongoose.Query.prototype.exec = function(arg1, arg2) {
return exec.call(this, 'exec', arguments);
};
mongoose.getCache = function() {
return cache;
};
if (typeof Aggregate !== 'undefined') {
Aggregate.prototype.exec = function(arg1, arg2) {
return exec.call(this, 'execAggregate', arguments);
Expand Down