def query_document(self, document_template: dict, graph_type: str='instance', skip: int=0, count: Optional[int]=None, as_list: bool=False, get_data_version: bool=False, **kwargs) -> Union[(Iterable, list)]:
    'Retrieves all documents that match a given document template\n\n        Parameters\n        ----------\n        document_template : dict\n            Template for the document that is being retrived\n        graph_type : str, optional\n            Graph type, either "instance" or "schema".\n        as_list: bool\n            If the result returned as list rather than an iterator.\n        get_data_version: bool\n            If the data version of the document(s) should be obtained. If True, the method return the result and the version as a tuple.\n\n        Raises\n        ------\n        InterfaceError\n            if the client does not connect to a database\n\n        Returns\n        -------\n        Iterable\n        '
    self._validate_graph_type(graph_type)
    self._check_connection()
    payload = {'query': document_template, 'graph_type': graph_type}
    payload['skip'] = skip
    if (count is not None):
        payload['count'] = count
    add_args = ['prefixed', 'minimized', 'unfold']
    for the_arg in add_args:
        if (the_arg in kwargs):
            payload[the_arg] = kwargs[the_arg]
    result = requests.post(self._documents_url(), headers={'user-agent': f'terminusdb-client-python/{__version__}', 'X-HTTP-Method-Override': 'GET'}, json=payload, auth=self._auth())
    if get_data_version:
        (result, version) = _finish_response(result, get_data_version)
        return_obj = _result2stream(result)
        if as_list:
            return (list(return_obj), version)
        else:
            return (return_obj, version)
    return_obj = _result2stream(_finish_response(result))
    if as_list:
        return list(return_obj)
    else:
        return return_obj
Retrieves all documents that match a given document template

Parameters
----------
document_template : dict
    Template for the document that is being retrived
graph_type : str, optional
    Graph type, either "instance" or "schema".
as_list: bool
    If the result returned as list rather than an iterator.
get_data_version: bool
    If the data version of the document(s) should be obtained. If True, the method return the result and the version as a tuple.

Raises
------
InterfaceError
    if the client does not connect to a database

Returns
-------
Iterable
def query_document(self, document_template: dict, graph_type: str='instance', skip: int=0, count: Optional[int]=None, as_list: bool=False, get_data_version: bool=False, **kwargs) -> Union[(Iterable, list)]:
    'Retrieves all documents that match a given document template\n\n        Parameters\n        ----------\n        document_template : dict\n            Template for the document that is being retrived\n        graph_type : str, optional\n            Graph type, either "instance" or "schema".\n        as_list: bool\n            If the result returned as list rather than an iterator.\n        get_data_version: bool\n            If the data version of the document(s) should be obtained. If True, the method return the result and the version as a tuple.\n\n        Raises\n        ------\n        InterfaceError\n            if the client does not connect to a database\n\n        Returns\n        -------\n        Iterable\n        '
    self._validate_graph_type(graph_type)
    self._check_connection()
    payload = {'query': document_template, 'graph_type': graph_type}
    payload['skip'] = skip
    if (count is not None):
        payload['count'] = count
    add_args = ['prefixed', 'minimized', 'unfold']
    for the_arg in add_args:
        if (the_arg in kwargs):
            payload[the_arg] = kwargs[the_arg]
    result = requests.post(self._documents_url(), headers={'user-agent': f'terminusdb-client-python/{__version__}', 'X-HTTP-Method-Override': 'GET'}, json=payload, auth=self._auth())
    if get_data_version:
        (result, version) = _finish_response(result, get_data_version)
        return_obj = _result2stream(result)
        if as_list:
            return (list(return_obj), version)
        else:
            return (return_obj, version)
    return_obj = _result2stream(_finish_response(result))
    if as_list:
        return list(return_obj)
    else:
        return return_obj