def METHOD_NAME(node, context):
    """
    Supports the following syntax:
    - ancestor_exists({ancestor_path_expression}, {ancestor_filter})
    i.e. ancestor-exists(host/parent,city='SF')
    Since ES has no way of performing joins, we filter down in stages:
    1. Find the ids of all cases where the condition is met
    2. Walk down the case hierarchy, finding all related cases with the right identifier to the ids
    found in (1).
    3. Return the lowest of these ids as a related case query filter
    """
    confirm_args_count(node, 2)
    ancestor_path_node, ancestor_case_filter_node = node.args
    return process_ancestor_exists(ancestor_path_node, ancestor_case_filter_node, context)