Blame view

node_modules/mongojs/test/test-disinct.js 432 Bytes
46de8790   Tarpit Grover   first commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
var test = require('./tape');
var insert = require('./insert');

insert('distinct', [{
  goodbye:'world',
  hello:'space'
}, {
  goodbye:'world',
  hello:'space'
}, {
  goodbye:'earth',
  hello:'space'
}, {
  goodbye:'world',
  hello:'space'
}], function(db, t, done) {
  db.a.distinct('goodbye',{hello:'space'},function(err, docs) {
    t.ok(!err);
    t.equal(docs.length, 2);
    t.equal(docs[0], 'world');
    done();
  });
});