A Swiss Army Knife to work with mongoose that easy find and cache data


stars 🌟issues ⚠️updated 🛠created 🐣size 🏋️‍♀️
02Mar 12, 2018Oct 21, 2017Minified + gzip package size for @app-masters/mongoose-it in KB




On you schema files add:

const mongooseIt = require('@app-masters/mongoose-it').mongooseIt;   

... your schema declaration ...   

var mongooseSchema = mongoose.Schema(schema, options);
var model = mongoose.model('user', mongooseSchema);

It will start mongoose to that model adding some new methods:

  • findIt()
  • findItOne()
  • findItById()
  • findItAndUpdate()
  • findItOneAndUpdate()
  • exists()

If you want to use cache:

  • findItCache()
  • findItOneCache()
  • findItByIdCache()
  • findItOneAndUpdateCache()

To work will whole schema cache:

  • flushAll()
  • cacheAll()
  • getAllCache()

To use with and model object instance:

  • getCacheKey()
  • cacheIt()


Uses node-cache to store and retrieve data from memory.


Internally used to provide cache methods to yours models.


Some mongoose useful functions to easy our work.

Change Log

Check all changes on changelog.

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.