MongoDB Aggregation join array of strings to single string

前端 未结 4 867
长发绾君心
长发绾君心 2021-02-12 15:14

We\'re trying to \'join\' an array of strings to a single string within an aggregation.

Given is the following dataset:

Collection 1:

{
  id: 123         


        
4条回答
  •  囚心锁ツ
    2021-02-12 15:23

    To flatten this array, you need to shift process to client.

    mongo will provide some new flattening options in new edition, but afaik it will be arithmetic ones (avg, min, max....).

提交回复
热议问题