Hi,
I have an object like this:
{
"a": "1",
"b": [
{
"id": 1,
"c": "IN",
"d": "1st In Value"
},
... other items in array
{
"id": 2,
"c": "OUT",
"d": "2nd Value"
},
... other items in array
{
"id": 3,
"c": "IN",
"d": "last In Value"
}
... other items in array none of which has "c" as "IN"
]
}
I want the n1ql query to return me results based on first and last entry where “c” is “IN”.
The first query (based on where condition having first entry of c is “IN”) should return
{
"a": "1",
"b": [{
"id": 1,
"c": "IN",
"d": "1st In Value"
}]
}
The 2nd query (based on where condition having last entry of c is “IN”) should return
{
"a": "1",
"b": [{
"id": 3,
"c": "IN",
"d": "last In Value"
}]
}