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

@app-masters/mongoose-it

Package Overview
Dependencies
Maintainers
4
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@app-masters/mongoose-it

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

  • 1.0.13
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
4
Created
Source

mongoose-it

Mongoose-it

On you schema files add:

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

... your schema declaration ...   

var mongooseSchema = mongoose.Schema(schema, options);
mongooseSchema.plugin(mongooseIt);
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()

AMCache

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

MongooseCache-it

Internally used to provide cache methods to yours models.

Util

Some mongoose useful functions to easy our work.

Change Log

Check all changes on changelog.

Keywords

FAQs

Package last updated on 12 Mar 2018

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