def update_document(self, document: Union[(dict, List[dict], 'WOQLSchema', 'DocumentTemplate', List['DocumentTemplate'])], graph_type: str='instance', commit_msg: Optional[str]=None, last_data_version: Optional[str]=None, compress: Union[(str, int)]=1024) -> None:
    'Updates the specified document(s). Add the document if not existed.\n\n        Parameters\n        ----------\n        document: dict or list of dict\n            Document(s) to be updated.\n        graph_type : str\n            Graph type, either "instance" or "schema".\n        commit_msg : str\n            Commit message.\n        last_data_version : str\n            Last version before the update, used to check if the document has been changed unknowingly\n        compress : str or int\n            If it is an integer, size of the data larger than this (in bytes) will be compress with gzip in the request (assume encoding as UTF-8, 0 = always compress). If it is `never` it will never compress the data.\n\n        Raises\n        ------\n        InterfaceError\n            if the client does not connect to a database\n        '
    self.replace_document(document, graph_type, commit_msg, last_data_version, compress, True)
Updates the specified document(s). Add the document if not existed.

Parameters
----------
document: dict or list of dict
    Document(s) to be updated.
graph_type : str
    Graph type, either "instance" or "schema".
commit_msg : str
    Commit message.
last_data_version : str
    Last version before the update, used to check if the document has been changed unknowingly
compress : str or int
    If it is an integer, size of the data larger than this (in bytes) will be compress with gzip in the request (assume encoding as UTF-8, 0 = always compress). If it is `never` it will never compress the data.

Raises
------
InterfaceError
    if the client does not connect to a database
def update_document(self, document: Union[(dict, List[dict], 'WOQLSchema', 'DocumentTemplate', List['DocumentTemplate'])], graph_type: str='instance', commit_msg: Optional[str]=None, last_data_version: Optional[str]=None, compress: Union[(str, int)]=1024) -> None:
    'Updates the specified document(s). Add the document if not existed.\n\n        Parameters\n        ----------\n        document: dict or list of dict\n            Document(s) to be updated.\n        graph_type : str\n            Graph type, either "instance" or "schema".\n        commit_msg : str\n            Commit message.\n        last_data_version : str\n            Last version before the update, used to check if the document has been changed unknowingly\n        compress : str or int\n            If it is an integer, size of the data larger than this (in bytes) will be compress with gzip in the request (assume encoding as UTF-8, 0 = always compress). If it is `never` it will never compress the data.\n\n        Raises\n        ------\n        InterfaceError\n            if the client does not connect to a database\n        '
    self.replace_document(document, graph_type, commit_msg, last_data_version, compress, True)