def _filter_direct_matching(key: dict, all_data: list, *, inverse: bool=False) -> tuple:
    """Filter through all data to return only the documents which match the key.
    `inverse` keyword-only argument is for those cases when we want to retrieve all documents which do NOT match the `check`."""
    if not inverse:
        def check(element: dict) -> bool:
            return all([True if i in element.items() else False for i in key.items()])
    else:
        def check(element: dict) -> bool:
            return all([False if i in element.items() else True for i in key.items()])
    results = filter(check, all_data)
    return tuple(results)