I'm using mongodb aggregation and added a facet stage. Here is the output of this stage.
{
"a": [{x: 1}, {x: 2}],
"b": [{x: 3}, {x: 4}]
}
Now I want to get rid of the a and b keys and create a list of objects from it. So final result should be like the following:
[
{x: 1},
{x: 2},
{x: 3},
{x: 4}
]
What should I use in to aggregation pipeline for this?