Function for cleanup doc and ops in mongo