|
|
@ -9,9 +9,10 @@ insert('aggregate', [{ |
|
|
|
name: 'Charmander', type: 'fire' |
|
|
|
}, { |
|
|
|
name: 'Lapras', type: 'water' |
|
|
|
}], function (db, t, done) { |
|
|
|
}], function (db, t) { |
|
|
|
db.a.aggregate({$group: {_id: '$type'}}, function (err, types) { |
|
|
|
console.log(err, types) |
|
|
|
t.error(err) |
|
|
|
|
|
|
|
var arr = types.map(function (x) { return x._id }) |
|
|
|
t.equal(types.length, 2) |
|
|
|
t.notEqual(arr.indexOf('fire'), -1) |
|
|
|