Let's say I have the following documents in my collection:
{
_id: xxx,
region: "sw"
},
{
_id: yyy,
region: "nw"
}
I am aiming to create an array like this:
['sw', 'nw']
Despite attempting mongodb aggregation/group and mapreduce, I keep ending up with an array of documents that need to be looped through again to get a single array. Is there a method to achieve this outcome in just one mongodb query or will it always necessitate initial querying followed by additional processing?