Open
Description
What to use as the cache key?
SQLDataSource uses the SQL query string:
https://github.com/cvburgess/SQLDataSource/blob/master/SQLCache.js#L19
Don't know if there's an equivalent for MongoDB. Cachegoose (caching for Mongoose) uses a hash of all these query properties:
https://github.com/boblauer/cachegoose/blob/master/src/extend-query.js#L70
Don't know if any of that is specific to Mongoose.
How to intercept queries?
Cachegoose monkeypatches mongoose.Query.prototype.exec
:
https://github.com/boblauer/cachegoose/blob/master/src/extend-query.js#L6-L8
Ideally we would support the mongodb
library as well.
Cachegoose also does aggregations, which we could do.