I have JSON object for filter
"filter": {
"logic": "and",
"filters": [
{
"field": "testName",
"operator": "contains",
"value": "ou"
},
{
"logic": "or",
"filters": [
{
"field": "testCode",
"operator": "contains",
"value": "ol"
},
{
"field": "sampleType",
"operator": "contains",
"value": "Blood"
}`enter code here`
]
}
]
}
want to convert to typeorm where query.output will be
SELECT `test_list`.`id` AS `test_list_id`, `test_list`.`test_name` AS `test_list_test_name`, `test_list`.`test_code` AS `test_list_test_code`, `test_list`.`sample_type` AS `test_list_sample_type`, `test_list`.`created_at` AS `test_list_created_at`, `test_list`.`updated_at` AS `test_list_updated_at` FROM `test_list` WHERE (`test_list`.`test_name` LIKE '%ol%' AND ((`test_list`.`test_code` LIKE '%ol%' OR `test_list`.`sample_type` LIKE '%Blood%'))) ORDER BY `test_list`.`id` ASC LIMIT 10'
Please solve my problem .