Skip to content

Additinally cache parameter added#15

Open
nihalsheik wants to merge 2 commits intoGottox:masterfrom
nihalsheik:master
Open

Additinally cache parameter added#15
nihalsheik wants to merge 2 commits intoGottox:masterfrom
nihalsheik:master

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

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

Comments