How to combine the field of the array of all documents together in MongoDB?

For example:

My collection contains these documents:

```
[
  {
    _id: 0,
    categories: ['a', 'b', 'c'],
  },
  {
    _id: 1,
    categories: ['d', 'e', 'f'],
  },
  {
    _id: 2,
    categories: ['g', 'h', 'i'],
  },
];

```

And the result must be:

```
['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i']

```