var collectionName = "batch_write_protocol";
var coll = db.getCollection(collectionName);
jsTest.log("Starting insert tests...");
coll.remove({});
var request;
var result;
coll.dropIndexes();
coll.drop();
request = {insert : collectionName, documents: [{a:1}], writeConcern:{w:-100}, ordered:true};
result = coll.runCommand(request)
assert.eq(0, result.ok);
assert.eq('number', typeof result.code);
assert.eq('string', typeof result.errmsg);
request = {update : collectionName, updates: [
{q: {a:1}, u: {$set: {a:1}}, upsert:true}
], writeConcern:{w:-100}, ordered:true};
result = coll.runCommand(request)
assert.eq(0, result.ok);
assert.eq('number', typeof result.code);
assert.eq('string', typeof result.errmsg);
request = {delete : collectionName, deletes: [
{q:{a:1}, limit:0}
], writeConcern:{w:-100}, ordered:true};
result = coll.runCommand(request)
assert.eq(0, result.ok);
assert.eq('number', typeof result.code);
assert.eq('string', typeof result.errmsg);