Implement updating a document.