Document structure :
{
“listOfDtls”: [
{
“TimeZone”: “Asia/Kolkata”,
“HPslCd”: “362”,
“LPslCd”: “362”,
“Country”: “IN”,
“City”: “RAJKOT”,
“State”: “GUJRAT”
},
{
“TimeZone”: “Asia/Kolkata”,
“HPslCd”: “362”,
“LPslCd”: “362”,
“Country”: “IN”,
“polDiv3Na”: “”,
“City”: “JUNAGHAD”,
“State”: “GUJRAT”
},
{
“tznGeoRefTe”: “Asia/Kolkata”,
“HPslCd”: “362”,
“LPslCd”: “362”,
“Country”: “IN”,
“polDiv3Na”: “”,
“City”: “JUNAGADH”,
“State”: “GUJARAT”
},
{
“tznGeoRefTe”: “Asia/Kolkata”,
“HPslCd”: “362”,
“LPslCd”: “362”,
“Country”: “IN”,
“polDiv3Na”: “”,
“City”: “MAJEVADI”,
“facLocNr”: “0117”,
“State”: “GUJARAT”
}
]
docType : ‘LOCDOC’
}
Query Used to retrieve :
SELECT t.listOfDtls[0] as timeZone FROM LOCATION t
WHERE t.docType=‘LOCDOC’ AND
ANY v IN listOfDtls SATISFIES v.Country=‘IN’ and v.City = ‘MAJEVADI’ END
Its returning all the matched and unmatched details in the listDtls . Am i doing anything wrong ?? I am trying to find the exact match in the array .
Please Help