Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mongoose-redis-caching

Package Overview
Dependencies
Maintainers
1
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mongoose-redis-caching

A simple caching solution for Mongoose working with Redis.

  • 1.13.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
11
decreased by-80.36%
Maintainers
1
Weekly downloads
 
Created
Source

mongoose-redis-caching

Simple and efficient mongoose redis caching solution

Package version License npm downloads CircleCI Greenkeeper badge code style: prettier Known Vulnerabilities

Package Quality

About

A simple Mongoose Redis caching module.

Installation

npm i mongoose-redis-caching

OR

yarn add mongoose-redis-caching

Usage

Require in the module

const mongoose = require("mongoose");
const mongooseRedisCaching = require("mongoose-redis-caching");

Configure your mongoose caching instance

mongooseRedisCaching(mongoose);

Add your own Redis URL to your .env file. The default is set to your local redis instance.

Then use as below (with Caching & no compression):

const blogs = await Blog.find({ _user: req.user.id }).cache();

With time expiration (in seconds, default is 60 sec):

const blogs = await Blog.find({ _user: req.user.id }).cache(15);

Use as below (without Caching):

const blogs = await Blog.find({ _user: req.user.id });

License

MIT

Coming soon

  • Expire items

Keywords

FAQs

Package last updated on 08 Nov 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc