mongodb シェルで次の集計をテストしましたが、正常に動作しますが、mongoose では動作しないようです。同様のトピックや問題を検索しましたが、それらの解決策は私のものを解決しません。
ドキュメント構成はこちら
{
  name,
  id,
  contacts:[{
    contactId, //I need an array of this field
    dateAdded
  }, {
    contactId,
    dateAdded
  },
  {}..]
}
マングースのスキーマは次のとおりです。
 var AccountSchema = new mongoose.Schema({
    email:     { type: String, unique: true },
    password:  { type: String },
    name: {
      first:   { type: String },
      last:    { type: String },
      full:    { type: String }
    },
    contacts:  [Contact]
  });
そして、ここに集計があります:
 Account.aggregate({
   $match: { _id: accountId }
 }, {
   $unwind:"$contacts"
 },
 {
   $group: {
     _id: '$_id',
     list: { $push:'$contacts.accountId' }
   }
 }, {
   $project: {
     _id: 0,
     contacts: 1
   }
 }, function(err, doc) {
   // var l=doc.result[0].list;
   callback(doc);  
 });
Mongodb シェルでは、アグリゲーションは以下に示すように contactID の配列を返しますが、Mongoose では空の配列を返します。
{
  "result" : [
    {
      "_id" : null,
      "list" : [
         ObjectId("xxxbnbnb2013-06-23T16:24:03.785Z"),
         ObjectId("mnmnmnmui2013-06-23T16:24:04.688Z")
      ]
    }
  ],
  "ok" : 1
}