def _to_couchbase_filter(standard_filters: MetadataFilters) -> Dict[str, Any]:
    """
    Convert standard filters to Couchbase filter.

    Args:
        standard_filters (str): Standard Llama-index filters.

    Returns:
        Dictionary with Couchbase search query.

    """
    filters = {}
    filters_list = []
    condition = standard_filters.condition
    condition = _transform_couchbase_filter_condition(condition)

    if standard_filters.filters:
        for filter in standard_filters.filters:
            if filter.operator:
                transformed_filter = _transform_couchbase_filter_operator(
                    filter.operator, f"metadata.{filter.key}", filter.value
                )

                filters_list.append(transformed_filter)
            else:
                filters_list.append(
                    {
                        "match": {
                            "field": f"metadata.{filter.key}",
                            "value": filter.value,
                        }
                    }
                )
    if len(filters_list) == 1:
        # If there is only one filter, return it directly
        return filters_list[0]
    elif len(filters_list) > 1:
        filters[condition] = filters_list
    return {"query": filters}

    Convert standard filters to Couchbase filter.

    Args:
        standard_filters (str): Standard Llama-index filters.

    Returns:
        Dictionary with Couchbase search query.

    
llama-index-integrations/vector_stores/llama-index-vector-stores-couchbase/llama_index/vector_stores/couchbase/base.py