Added write of output back to a mongo collection