# mongoose-cache **Repository Path**: mirrors_Gottox/mongoose-cache ## Basic Information - **Project Name**: mongoose-cache - **Description**: Caches Database querys the easy way. This module is currently not developed. Nevertheless, I will apply patches. - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-09-24 - **Last Updated**: 2026-03-08 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README [![Flattr this git repo](http://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=Gottox&url=https://github.com/Gottox/mongoose-cache&title=mongoose-cache&language=&tags=github&category=software) ### mongoose-cache Monkey patches Mongoose.Query to support in-memory caching. ## usage Monkey-Patching mongoose: ```javascript var mongoose = require('./mongoose') var cacheOpts = { max:50, maxAge:1000*60*2 }; require('mongoose-cache').install(mongoose, cacheOpts) ``` This means "cache up to 50 querys with a livetime of two minutes". See for all available options. For enabling this cache in your query just call .cache() ```javascript db.User.find({ ... }).cache().exec(function() { ... }) ``` For more talky output add ```debug: true``` to the cacheOpts.