summaryrefslogtreecommitdiff
path: root/jstests/mmap_v1/repair_cursor1.js
blob: fefc9bbdecb8e96b180f53c9779335a16ab7aef2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

t = db.repair_cursor1;
t.drop();

t.insert({x: 1});
t.insert({x: 2});

res = t.runCommand("repairCursor");
assert(res.ok, tojson(res));

t2 = db.repair_cursor1a;
t2.drop();

cursor = new DBCommandCursor(db._mongo, res);
cursor.forEach(function(z) {
    t2.insert(z);
});
assert.eq(t.find().itcount(), t2.find().itcount());
assert.eq(t.hashAllDocs(), t2.hashAllDocs());