How Mongodb merges subdocuments through aggregation

in my collection,
has related different documents, and only one field is different between them, assuming field

.

how to merge different related documents into one document
and turn this field into an array of fields [],

is it done through aggregation?

Mar.04,2021
Menu