Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Caches Database querys the easy way. This module is currently not developed. Nevertheless, I will apply patches.

License

Notifications You must be signed in to change notification settings

codecombat/mongoose-cache

Open more actions menu
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flattr this git repo

mongoose-cache

Monkey patches Mongoose.Query to support in-memory caching.

usage

Monkey-Patching mongoose:

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 https://github.com/isaacs/node-lru-cache#options for all available options.

For enabling this cache in your query just call .cache()

db.User.find({ ... }).cache().exec(function() { ... })

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

About

Caches Database querys the easy way. This module is currently not developed. Nevertheless, I will apply patches.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%
Morty Proxy This is a proxified and sanitized view of the page, visit original site.