Update the flattened document.