I would like to use cachegoose https://www.npmjs.com/package/cachegoose with mongoose but I have to use TypeScript. If I just want to add the .cache option so I can use the below how would I do that?
I dont want to replace the mongoose index.d.ts and I don't have time/knowledge to make a typing's file for cachegoose, I simply want to add the functionality as easily as possible. Something like a Global.d.ts where I can extended mongoose and add cache: any. (Similar to how you can extend the pallet for Material UI)
Record
.find({ some_condition: true })
.cache(30) // The number of seconds to cache the query. Defaults to 60 seconds.
.exec(function(err, records) {
...
});