Handling of jobs in multi-node environments using MongoDB