summaryrefslogtreecommitdiff
path: root/jstests/sharding/cleanup_orphaned.js
blob: a63991f7a23d545c84d2396f203283021d499ede (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//
// Shards data from the key range, then inserts orphan documents, runs cleanupOrphans
// and makes sure that orphans are removed. Uses an _id as a shard key.
//

load('./jstests/libs/cleanup_orphaned_util.js');

testCleanupOrphaned({
    shardKey: {_id: 1},
    keyGen: function() {
        var ids = [];
        for (var i = -50; i < 50; i++) {
            ids.push({_id: i});
        }
        return ids;
    }
});