MongoDB how to kill / end map_reduce?

I'm not sure if this is possible, but I wanted to know if we have a solution to this problem. I was given the map_reduce task (they took an additional measure to make an incremental request so that the data set was minimal) if for a long time I want to kill the task either using the pymongo API or in the mongoDB shell ...... and also elegantly deletes all temporary tables. It can be done?

+4
source share
1 answer

As for killing the operation, then you need currentOp() find the identifier op, and then the killOp() command to kill the operation in the shell. See here for more details:

http://www.mongodb.org/display/DOCS/Viewing+and+Terminating+Current+Operation#ViewingandTerminatingCurrentOperation-KillinganInProgressOperation

Once the operation is killed, you can safely remove temporary collections, it is just a matter of calling drop() on the collision list. I could build some javascript to do this automatically in the shell, but given the likelihood of an error and dumping the wrong collections, this might be a bad idea.

+4
source

All Articles