-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Additinally cache parameter added #15
base: master
Are you sure you want to change the base?
Conversation
db.User.find({ ... }).cache().exec(function(err, result, cache) { ... }) The third parameter 'cache' will indicate whether the data is coming from cache or db |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For what do you need this information? You can't do anything with it :) Also: What does true/false mean? It's not documented, so I wouldn't say, that a boolean is the best data type for this parameter :/
@@ -46,15 +46,17 @@ exports.install = module.exports.install = function(mongoose, options, Aggregate | |||
log('save to cache: ', key); | |||
cache.set(key, obj); | |||
} | |||
this.apply(this, arguments); | |||
var t = Array.prototype.slice.call(arguments); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
false indention.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In order to find whether the data is coming from cache or not , I have introduced the third parameter(boolean)
In order to find whether the data is coming from cache or not , I have introduced the third parameter(boolean) |
Yeah, I understand what the PR implements, my question is: What problem do you try to fix. What is the purpose of this information. If know, if the data comes from the cache, what would you do with it differently, compared to data that does not come from the cache. What is the benefit from knowing if this is cached data :) |
This is additional feature, I had faced the problem two years back. So that I have added. It may use for people whoever facing similar kind of issue. |
No description provided.