summaryrefslogtreecommitdiff
path: root/jstests/concurrency/fsm_workloads/indexed_insert_1char.js
blob: 5330bd9191e4ae5b53666fcfb643782128050560 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
'use strict';

/**
 * indexed_insert_1char.js
 *
 * Inserts multiple documents into an indexed collection. Asserts that all
 * documents appear in both a collection scan and an index scan. The indexed
 * value is a 1-character string based on the thread's id.
 */
load('jstests/concurrency/fsm_libs/extend_workload.js');           // for extendWorkload
load('jstests/concurrency/fsm_workloads/indexed_insert_base.js');  // for $config

var $config = extendWorkload($config,
                             function($config, $super) {

                                 $config.data.indexedField = 'indexed_insert_1char';
                                 $config.data.shardKey = {};
                                 $config.data.shardKey[$config.data.indexedField] = 1;

                                 $config.states.init = function init(db, collName) {
                                     $super.states.init.apply(this, arguments);

                                     this.indexedValue = String.fromCharCode(33 + this.tid);
                                 };

                                 return $config;
                             });