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

About some update and delete operation in the code. #29

Closed
YanxinNet opened this issue Sep 28, 2022 · 3 comments · Fixed by #30
Closed

About some update and delete operation in the code. #29

YanxinNet opened this issue Sep 28, 2022 · 3 comments · Fixed by #30

Comments

@YanxinNet
Copy link

Hello, I have a question to ask. I don't see the function of modifying or deleting the affected cache when updating records in the document and source code,
For example, when I update a document, theoretically, I should clear the cache records of the document. There is no schema in the source code The function of post ('update ', xxx).
In addition, if I use deleteMany or deleteOne to delete documents, the source code only executes schema Post ('remove ', xxx), but no schema Post ('deleteOne ', xxx), etc

@arqo123
Copy link
Owner

arqo123 commented Sep 28, 2022

Hello @YanxinNet ! Thanks for using speedgoose! What is your current experience of using it?
If i understand you correctly you're asking for additional events for SpeedGooseCacheAutoCleaner? Good point! I will extend plugin auto-clear ability to support more events. However, I'm not sure how with actions like updateMany and deleteMany etc. I will see how much information can I find in those hooks.
I will try to make it this week.

@YanxinNet
Copy link
Author

Hello @YanxinNet ! Thanks for using speedgoose! What is your current experience of using it? If i understand you correctly you're asking for additional events for SpeedGooseCacheAutoCleaner? Good point! I will extend plugin auto-clear ability to support more events. However, I'm not sure how with actions like updateMany and deleteMany etc. I will see how much information can I find in those hooks. I will try to make it this week.

I think your plugin is good, It make me learn more.
To be honest, when it comes to deleteMany, I have no idea how to update the cache, so the current practice is to add a prefix of model to each cache, and when a model has new or deleted data, delete all caches related to this model.

@arqo123 arqo123 linked a pull request Sep 30, 2022 that will close this issue
@arqo123
Copy link
Owner

arqo123 commented Sep 30, 2022

@YanxinNet I've just finished tests of new mongoose events :). A list of currently supported events was added to the readme.

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 a pull request may close this issue.

2 participants