I am trying to store and utilizing forecast data. There are zillions of these records. Considering the three documents included below (3 of zillions), I want to find the unique set of keys in the data map.
I understand
select raw object_names(mdata.data) from mdata where type="DD" and docType="CTC" and subset="METAR" and version="V01" and model='HRRR' limit 3;
which gives …
[
[
"1000",
"3000",
"500",
"60000"
],
[
"1000",
"3000",
"500",
"60000"
],
[
"1000",
"3000",
"500",
"60000"
]
]
But I don’t quite grok how to get a unique set of values from the resulting list of arrays. I know how to do it in code, of course, but I wonder if it wouldn’t be more efficient to do it in N1QL.
Any help would be greatly appreciated.
thanks,
this is the data…
[
{
"data": {
"500": {
"correct_negatives": 1297,
"false_alarms": 25,
"hits": 15,
"misses": 10
},
"1000": {
"correct_negatives": 1224,
"false_alarms": 45,
"hits": 61,
"misses": 17
},
"3000": {
"correct_negatives": 1104,
"false_alarms": 65,
"hits": 142,
"misses": 36
},
"60000": {
"correct_negatives": 797,
"false_alarms": 194,
"hits": 236,
"misses": 120
}
},
"dataFileId": "DF_id",
"dataSourceId": "DS_id",
"docType": "CTC",
"fcstLen": 3,
"fcstValidBeg": "2018-01-26T14:00:00Z",
"fcstValidEpoch": 1516975200,
"model": "HRRR",
"region": "E_HRRR",
"subset": "METAR",
"type": "DD",
"version": "V01"
},
{
"data": {
"500": {
"correct_negatives": 1309,
"false_alarms": 13,
"hits": 13,
"misses": 12
},
"1000": {
"correct_negatives": 1234,
"false_alarms": 35,
"hits": 52,
"misses": 26
},
"3000": {
"correct_negatives": 1124,
"false_alarms": 45,
"hits": 121,
"misses": 57
},
"60000": {
"correct_negatives": 713,
"false_alarms": 278,
"hits": 211,
"misses": 145
}
},
"dataFileId": "DF_id",
"dataSourceId": "DS_id",
"docType": "CTC",
"fcstLen": 6,
"fcstValidBeg": "2018-01-26T14:00:00Z",
"fcstValidEpoch": 1516975200,
"model": "HRRR",
"region": "E_HRRR",
"subset": "METAR",
"type": "DD",
"version": "V01"
},
{
"data": {
"500": {
"correct_negatives": 1315,
"false_alarms": 6,
"hits": 8,
"misses": 17
},
"1000": {
"correct_negatives": 1250,
"false_alarms": 29,
"hits": 51,
"misses": 16
},
"3000": {
"correct_negatives": 1124,
"false_alarms": 53,
"hits": 129,
"misses": 40
},
"60000": {
"correct_negatives": 685,
"false_alarms": 284,
"hits": 248,
"misses": 129
}
},
"dataFileId": "DF_id",
"dataSourceId": "DS_id",
"docType": "CTC",
"fcstLen": 6,
"fcstValidBeg": "2018-01-26T17:00:00Z",
"fcstValidEpoch": 1516986000,
"model": "HRRR",
"region": "E_HRRR",
"subset": "METAR",
"type": "DD",
"version": "V01"
}
]