I have a json file like this:
[
{
"id": 100,
"name": "teste",
"name_test": 3,
"external_id": "12345",
"id_job": 14,
"active": true,
"email": "[email protected]",
"phone_country": "55",
"start_date": "1970-01-01",
"created_at": "2019-07-15 20:22:44",
"created_by": 122,
"created_by_name": "teste"
},
{
"id": 101,
"name": "teste",
"name_test": 3,
"external_id": "12345",
"id_job": 67,
"active": true,
"email": "[email protected]",
"phone_country": "55",
"start_date": "1970-01-01",
"created_at": "2019-07-15 20:22:44",
"created_by": 122,
"created_by_name": "teste"
},
{
"id": 102,
"name": "teste",
"name_test": 3,
"external_id": "12345",
"id_job": 21,
"active": false,
"email": "[email protected]",
"phone_country": "55",
"start_date": "1970-01-01",
"created_at": "2019-07-15 20:22:44",
"created_by": 122,
"created_by_name": "teste"
}
]
I need to filter only "active": true AND "id_job": 14,67
Here is my code I've trying,
result['data'] = [x for x in result['data'] if x['id_job'] in [14,67] and x['active'] == 'true']
The result should be like this
[
{
"id": 100,
"name": "teste",
"name_test": 3,
"external_id": "12345",
"id_job": 14,
"active": true,
"email": "[email protected]",
"phone_country": "55",
"start_date": "1970-01-01",
"created_at": "2019-07-15 20:22:44",
"created_by": 122,
"created_by_name": "teste"
},
{
"id": 101,
"name": "teste",
"name_test": 3,
"external_id": "12345",
"id_job": 67,
"active": true,
"email": "[email protected]",
"phone_country": "55",
"start_date": "1970-01-01",
"created_at": "2019-07-15 20:22:44",
"created_by": 122,
"created_by_name": "teste"
}
]
but as result I receive this
[
[],
[]
]
My question is similar this one filter json file with python, but I need to put value in the filter

true != 'true'