summaryrefslogtreecommitdiff
path: root/jstests/core/find2.js
blob: a793c60b804f1fb28683cdcf14c4249df28f86a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Test object id sorting.
//
// @tags: [requires_fastcount]

function testObjectIdFind(db) {
    r = db.ed_db_find2_oif;
    r.drop();

    for (i = 0; i < 3; ++i)
        r.save({});

    f = r.find().sort({_id: 1});
    assert.eq(3, f.count());
    assert(f[0]._id < f[1]._id);
    assert(f[1]._id < f[2]._id);
}

testObjectIdFind(db);