compares the two orderby item pairs.
        :param dict orderby_item1:
        :param dict orderby_item2:

        :return:
            Integer comparison result.
            The comparator acts such that 
            - if the types are different we get:
                Undefined value < Null < booleans < Numbers < Strings
            - if both arguments are of the same type:
                it simply compares the values.

        :rtype: int

def compare(orderby_item1, orderby_item2):
        """compares the two orderby item pairs.
        :param dict orderby_item1:
        :param dict orderby_item2:

        :return:
            Integer comparison result.
            The comparator acts such that 
            - if the types are different we get:
                Undefined value < Null < booleans < Numbers < Strings
            - if both arguments are of the same type:
                it simply compares the values.

        :rtype: int

        """
        
        type1_ord = _OrderByHelper.getTypeOrd(orderby_item1)
        type2_ord = _OrderByHelper.getTypeOrd(orderby_item2)

        type_ord_diff = type1_ord - type2_ord

        if type_ord_diff:
            return type_ord_diff
        
        # the same type, 
        if type1_ord == 0:
            return 0

        return _compare_helper(orderby_item1['item'],  orderby_item2['item'])