I have following document
[
{
“report”: [
{
“action”: [
{
“commentCount”: “0”,
“flagCount”: “0”,
“likeCount”: “0”
}
],
“cat_id”: “1”,
“child_cat_id”: “5”,
“expiry_date”: “1807361887”,
“identifier”: “c5ed4cad9a5b3ecc7a238aca60a04926”,
“images”: [],
“modified_by”: null,
“pin_create_date”: 1487938839,
“pin_id”: “15689”,
“pin_privacy”: “1”,
“pin_rate”: “0”,
“pin_story”: “just a test please ignore”,
“pin_type”: “report”,
“place_id”: null,
“place_lat”: “22.563398”,
“place_long”: “88.351308”,
“place_name”: “Reported Event”,
“point”: “0”,
“progress”: “0”,
“social_id”: “web”,
“status”: “1”
},
{
“action”: [
{
“commentCount”: “0”,
“flagCount”: “0”,
“likeCount”: “0”
}
],
“cat_id”: “2”,
“child_cat_id”: “13”,
“expiry_date”: “1483228800”,
“identifier”: “1d5c5cccac39473f1d487a87503c979e”,
“images”: [],
“modified_by”: null,
“pin_create_date”: 1480535176,
“pin_id”: “11631”,
“pin_privacy”: “1”,
“pin_rate”: “0”,
“pin_story”: “again a test to test thing up”,
“pin_type”: “report”,
“place_id”: null,
“place_lat”: “28.77247418”,
“place_long”: “77.37876892”,
“place_name”: " 28.772474183943032,77.3787689",
“point”: “0”,
“progress”: “0”,
“social_id”: “web”,
“status”: “1”
},
{
“action”: [
{
“commentCount”: “0”,
“flagCount”: “0”,
“likeCount”: “0”
}
],
“cat_id”: “1”,
“child_cat_id”: “6”,
“expiry_date”: “1827291923”,
“identifier”: “0027459f3fa673bb58fa3ca397d44376”,
“images”: [],
“modified_by”: null,
“pin_create_date”: 1511759123,
“pin_id”: “46049”,
“pin_privacy”: “1”,
“pin_rate”: “0”,
“pin_story”: “Just a test report”,
“pin_type”: “report”,
“place_id”: “0”,
“place_lat”: “28.61279604”,
“place_long”: “77.22921111”,
“place_name”: “Reported Near War Memorial Arch”,
“point”: “0”,
“progress”: “0”,
“social_id”: “native”,
“status”: “1”
},
]}]
From above document I want to select only those report having cat_id = 1, I tried ANY and IN , but that did not work
Following is the where clause
WHERE 1 IN pin.report[*].cat_id