Update doc according to ID