Qache is a utility class for handling server side caching of MongoDB queries made with GraphQL.
Using npm:
$ npm i qache
In Node.js:
// Load the Qache class
var Qache = require('qache');
// Instantiate a cache
var cache = new Qache();
content
size
maxSize
TTL
get(key)
set(key, value)
listCreate(listKey, ...item)
listRange(listKey, start, end)
listPush(item, ...listKeys)
listRemoveItem(filterObject, ...listKey)
listUpdate(filterObject, newItem, ...listKey)
listFetch(listKey,filterObject)
invalidate(...keys)
Tested in Node.js 16.13.0
Automated unit tests are available.
See the complete package source for more details, as well as a fullstack demo application.