|
|
@ -12,7 +12,7 @@ insert('aggregate', [{ |
|
|
|
}], function (db, t, done) { |
|
|
|
db.a.aggregate({$group: {_id: '$type'}}, function (err, types) { |
|
|
|
console.log(err, types) |
|
|
|
var arr = types.map(function (x) {return x._id}) |
|
|
|
var arr = types.map(function (x) { return x._id }) |
|
|
|
t.equal(types.length, 2) |
|
|
|
t.notEqual(arr.indexOf('fire'), -1) |
|
|
|
t.notEqual(arr.indexOf('water'), -1) |
|
|
@ -20,7 +20,7 @@ insert('aggregate', [{ |
|
|
|
// test as a stream
|
|
|
|
var strm = db.a.aggregate({$group: {_id: '$type'}}) |
|
|
|
strm.pipe(concat(function (types) { |
|
|
|
var arr = types.map(function (x) {return x._id}) |
|
|
|
var arr = types.map(function (x) { return x._id }) |
|
|
|
t.equal(types.length, 2) |
|
|
|
t.notEqual(arr.indexOf('fire'), -1) |
|
|
|
t.notEqual(arr.indexOf('water'), -1) |
|
|
|