1.0.13 • Published 6 years ago

@app-masters/mongoose-it v1.0.13

Weekly downloads
21
License
ISC
Repository
github
Last release
6 years ago

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.

1.0.13

6 years ago

1.0.12

6 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago