def map_lc_mql_filter_operators(operator: FilterOperator) -> str:
    """Maps Llama-index FilterOperators to MongoDB Query Language."""
    operator_map = {
        FilterOperator.EQ: "$eq",  # = "=="  # default operator (string, int, float)
        FilterOperator.GT: "$gt",  # ">"  greater than (int, float)
        FilterOperator.LT: "$lt",  # = # "<"  # less than (int, float)
        FilterOperator.NE: "$ne",  # "!="  # not equal to (string, int, float)
        FilterOperator.GTE: "$gte",  # = ">="  # greater than or equal to (int, float)
        FilterOperator.LTE: "$lte",  # = "<="  # less than or equal to (int, float)
        FilterOperator.IN: "$in",  # = "in"  # metadata in value array (string or number)
        FilterOperator.NIN: "$nin",  # = "nin"  metadata not in value array (string, number)
        # FilterOperator.TEXT_MATCH: "NA", #  not supported as filter. See $text
        # FilterOperator.CONTAINS: "NA", # not supported as filter. Try $in
    }
    if operator not in operator_map:
        error_msg = f"Unsupported filter operator: {operator}"
        logger.error(error_msg)
        raise ValueError(error_msg)
    return operator_map[operator]
Maps Llama-index FilterOperators to MongoDB Query Language.
llama-index-integrations/vector_stores/llama-index-vector-stores-mongodb/llama_index/vector_stores/mongodb/pipelines.py