A Mongoose plugin that adds Redis caching to Mongoose queries. Version 1.13.2 is the latest stable release. It provides a `.cache()` chainable method on query results, with optional TTL in seconds (default 60). Works by wrapping Mongoose's `exec` method and caching query results in Redis. Differs from other caching libraries by its simplicity and direct integration with Mongoose without additional configuration.
npm install mongoose-redis-cachingNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates requiring the module, initializing it with Mongoose, and using .cache() on a query with a 30-second TTL.
Use require() instead of import. If you must use ES modules, consider wrapping or using dynamic import.
Ensure Redis is running and accessible at the configured URL before executing cached queries.
Always chain .cache() on a query, like Model.find().cache().
Replace 'import mongooseRedisCaching from 'mongoose-redis-caching'' with 'const mongooseRedisCaching = require('mongoose-redis-caching')'.Ensure .cache() is chained before await, like Model.find().cache().