I have been attempting to convert this code into TypeScript: https://github.com/kephin/Node_Redis-Caching/blob/master/services/cache.js , but I am struggling to extend the Query object successfully.
Currently, I am trying to extend it through declaration merging in a similar manner as I do with express, but unfortunately, it is not functioning as expected.
declare namespace Mongoose {
interface Query {
cache: any;
}