Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/app-masters/mongoose-it
A Swiss Army Knife to work with mongoose, to easy find and cache data
https://github.com/app-masters/mongoose-it
cache mongodb mongoose mongoose-plugin nodejs
Last synced: 5 days ago
JSON representation
A Swiss Army Knife to work with mongoose, to easy find and cache data
- Host: GitHub
- URL: https://github.com/app-masters/mongoose-it
- Owner: app-masters
- Created: 2017-10-21T16:04:27.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-03-12T17:09:39.000Z (over 6 years ago)
- Last Synced: 2024-10-18T14:55:20.132Z (30 days ago)
- Topics: cache, mongodb, mongoose, mongoose-plugin, nodejs
- Language: JavaScript
- Size: 18.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# 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](CHANGELOG.md).