title: How to aggregate multiple document with one array?
body: <p>Here is my data structure:</p>
  
  <pre><code>{
      "_id" : ObjectId("5becc8e2e9427e48d0edab83"),
      "theater" : "TodayTainan",
      "geometry" : {
          "type" : "Point",
          "coordinates" : [ 
              120.196866, 
              22.99322
          ]
      },
      "movie" : [ 
          {
              "movieDate" : "上映日期：2018-07-25",
              "videoId" : [ 
                  "17Y_lXjB3VI", 
                  "ovbEe1-qUZ0"
              ],
              "imdbScore" : "",
              "cnName" : "不可能的任務：全面瓦解",
              "photoHref" : "https://movies.yahoo.com.tw/x/r/w420/i/o/production/movies/June2018/8LBd1GYiRhtjZMCcdOSl-1019x1500.JPG",
              "rottenScore" : "",
              "releasedTime" : [ 
                  ISODate("2018-11-15T12:40:00.000Z"), 
                  ISODate("2018-11-15T17:20:00.000Z"), 
                  ISODate("2018-11-15T22:00:00.000Z")
              ],
              "enName" : "Mission: Impossible Fall Out",
              "goodMinePoint" : 0.75
          }, 
          {
              "movieDate" : "上映日期：2018-08-10",
              "videoId" : [ 
                  "j-FAn2jGI08", 
                  "6aWIWGBWlPk"
              ],
              "imdbScore" : "5.9",
              "cnName" : "巨齒鯊",
              "photoHref" : "https://movies.yahoo.com.tw/x/r/w420/i/o/production/movies/July2018/xO7qzzEwPCaipjCWkkxg-2714x3878.jpg",
              "rottenScore" : "45%",
              "releasedTime" : [ 
                  ISODate("2018-11-15T15:20:00.000Z"), 
                  ISODate("2018-11-15T20:00:00.000Z")
              ],
              "enName" : "The Meg",
              "goodMinePoint" : 0.3
          }
      ],
      "phone" : "06-2205151"
  }
  </code></pre>
  
  <p>I use <code>addToSet</code> to remove duplicate data with one document like this code:</p>
  
  <pre><code>db.getCollection('TaipeiEast').aggregate([
              { "$match": {
                    "theater": "TodayTainan"
                  }
              },
              { "$unwind": '$movie' },
              { "$group": {
                  "_id": "$_id",
                  "movie": {
                    "$addToSet": {
                      "cnName": "$movie.cnName",
                      "photoHref": "$movie.photoHref"
                    }
                  }
                } 
              }
            ])
  </code></pre>
  
  <p>Now I have a lots of documents in one collection, I want to query them become one movie array without duplicate movie.</p>
  
  <p>I try to remove <code>match</code> like this:</p>
  
  <pre><code>db.getCollection('TaipeiEast').aggregate([
                  { "$unwind": '$movie' },
                  { "$group": {
                      "_id": "$_id",
                      "movie": {
                        "$addToSet": {
                          "cnName": "$movie.cnName",
                          "photoHref": "$movie.photoHref"
                        }
                      }
                    } 
                  }
                ])
  </code></pre>
  
  <p>I can get all of documents data, but the movie array is independent with each of document.</p>
  
  <p>Any one knows how to generate one movie array from multiple documents ? Thanks in advance.</p>