Using this query:
select raw array_distinct(doc.beers[*].name) from `bucket` doc
where doc.type = 'brewer'
I can get the result:
[
[
"IPA",
"Pale Ale"
],
[
"Lager",
"Pale Ale",
"Stout",
"American Ale"
]
]
I’d like to put this result through array_flatten and array_distinct so that the final result is
[
[
"IPA",
"Lager",
"Pale Ale",
"Stout",
"American Ale"
]
]
The issue is I can’t figure out how to use ‘raw’ and the array functions in the same query. What’s the correct way?