update a document.