I tried to get the max of a nested object without any succes.
the document looks like this:
"r": {
"a": {
"aa": {
"bb": {
"3": {
"cr": 478,
"crt": 1611468000,
"hr": 471,
"hrt": 1611460800
},
"14": {
"cr": 449,
"crt": 1611482400,
"hr": 419,
"hrt": 1611460800
}
}
}
},
"b": {
"aa": {
"cc": {
"3": {
"cr": 445,
"crt": 1612364400,
"hr": 210,
"hrt": 1611464400
},
"14": {
"cr": 468,
"crt": 1611522000,
"hr": 244,
"hrt": 1611460800
}
}
}
}
}
What I am trying to do is to get the MAC of all these values for the field “hr”, For some reason, I could not flatten or unnest these objects.
In addition, would be great to be able to count the number of times we have the field “hrt” with the value between x and y where the “hr” is larger/smaller than a certain value.
Could this be done in a N1QL query?