Add support for document overwrite.