Implementation of mongo rollback with flag in collections.