Node Cache Manager store for MongoDB
The MongoDb store for the node-cache-manager module.
Special thx to @onlyurei and @dcolens
Installation
npm install cache-manager-mongodb --save
News
Switch to full Promise support.
New Mocha test (thx to @dcolens )
Usage examples
Here are examples that demonstrate how to implement the Mongodb cache store.
Single store
var cacheManager = ;var mongoStore = ; var mongoCache = cacheManager; var ttl = 60; mongoCache ;}); { return { ;} var userId = 123;var key = 'user_' + userId; // Note: ttl is optional in wrap()mongoCache
Multi-store
var cacheManager = ;var mongoStore = ; var mongoCache = cacheManager;var memoryCache = cacheManager; var multiCache = cacheManager; userId2 = 456;key2 = 'user_' + userId;ttl = 5; // Sets in all caches.multiCache ;}); // Note: ttl is optional in wrap()multiCache; { return { ; }});
Contribution
If you would like to contribute to the project, please fork it and send us a pull request.
License
node-cache-manager-mongodb
is licensed under the MIT license.