Manually terminate and R process and do something in Mongo when it happens

I want to kill an R process manually and want something to be executed at that time.
For example, I have integrated my data and processed with MongoDB. So for instance, if I have to stop an R code manually at some point, I want a process status to be changed in MongoDB to, say, "STOPPED".

Can someone tell me how to do it? Thanks in advance!

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.