title: Mongodb aggregation - replicate document
body: <p>I'm trying to generate a navigation out of an article collection. I have articles in different languages. The problem I have is that the articles marked with an '*' in the lang field should appear in every language. So i would have to replicate and insert them in every navigation. Would that be possible with the aggregation framework?</p>
  
  <pre class="lang-js prettyprint-override"><code>[
      { "$match": { "active":{ "$gte" :0 } }},
      { "$project":{ 
          "_id" :1,
          "lang":"$lang", 
          "topNav": { "name": "$title", "link": "$path" }
      }},
      { "$group": { 
          "_id":{ "lang":'$lang'},
           "topNav":{ "$push": "$topNav" }
      }},
      { "$out": "navigation" }
  ]
  </code></pre>
  
  <p>Final Array</p>
  
  <pre class="lang-js prettyprint-override"><code>[
      { 
           "_id" :{ "lang":"en" },
           "topNav":[
               {
                   "name": "Main Article",
                   "link": "/"
               },
               {
                   "name": "Admin",
                   "link": "/admin"
               }
           ]
       },{ 
           "_id" :{ "lang":"de" },
           "topNav":[
               {
                   "name": "Main Article De",
                   "link": "/"
               },
               {
                   "name": "Admin",
                   "link": "/admin"
               }
           ]
       }
  ]
  </code></pre>
  
  <p>Articles</p>
  
  <pre class="lang-js prettyprint-override"><code>{
  "_id" : ObjectId("1"),
  "path" : "/",
  "title" : "Main Article",
  "content" : "Main Site!",
  "lang" : "en",
  },{
  "_id" : ObjectId("2"),
  "path" : "/admin",
  "title" : "Admin",
  "content" : "Admin Site!",
  "lang" : "*",
  },{
  "_id" : ObjectId("3"),
  "path" : "/",
  "title" : "Main Article De",
  "content" : "Main Site! De",
  "lang" : "de",
  }
  </code></pre>