我有查询字符串,我需要转换json对象,如下所示
((blue AND green) OR (brown AND green) OR green) AND NOT red
{
"filter": {
"operator": "and",
"filters": [{
"operator": "or",
"filters": [{
"operator": "and",
"filters": [{
"means": "contains",
"value": "blue"
},
{
"means": "contains",
"value": "green"
}
]
},
{
"operator": "and",
"filters": [{
"means": "contains",
"value": "brown"
},
{
"means": "contains",
"value": "green"
}
]
},
{
"means": "contains",
"value": "green"
}
]
},
{
"means": "not contains",
"value": "red"
}
]
}
}
你可以帮帮我吗?如何将查询转换为相同的字典,我需要良好的映射解决方案