Hi
I have the below document structure .
{
"account": "ABC",
"eLimits": [
{
"amount": 213,
"cId": 3
},
{
"amount": 213,
"cId": 2
}
]
}
My requirement is fetch account and eLimits information which have CId=3 .
The result for the Query -
select account,eLimits from data
, without any filter conditon , fetches below result
I need to add filter condition to this query , so that it will only have any eLimits with CId= 3
[
{
"account": "ABC",
"eLimits": [
{
"amount": 213,
"cId": 3
},
{
"amount": 213,
"cId": 2
}
]
},
{
"account": "CDE",
"eLimits": [
{
"amount": 213,
"cId": 3
},
{
"amount": 213,
"cId": 1
}
]
},
{
"account": "FGH",
"eLimits": [
{
"amount": 213,
"cId": 3
},
{
"amount": 213,
"cId": 4
}
]
}
]
Desire Output:
[
{
"account": "ABC",
"eLimits": [
{
"amount": 213,
"cId": 3
}
]
},
{
"account": "CDE",
"eLimits": [
{
"amount": 213,
"cId": 3
}
]
},
{
"account": "FGH",
"eLimits": [
{
"amount": 213,
"cId": 3
}
]
}
]