Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

nihalsheik
Copy link

No description provided.

@nihalsheik
Copy link
Author

db.User.find({ ... }).cache().exec(function(err, result, cache) { ... })

The third parameter 'cache' will indicate whether the data is coming from cache or db

@nihalsheik nihalsheik closed this Dec 8, 2015
@nihalsheik nihalsheik reopened this Dec 8, 2015
Copy link

@FlorianSW FlorianSW left a 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);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

false indention.

Copy link
Author

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)

@nihalsheik
Copy link
Author

In order to find whether the data is coming from cache or not , I have introduced the third parameter(boolean)

@FlorianSW
Copy link

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 :)

@nihalsheik
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants