dbs-and-docs-test-bulkAddDriver
module.exports = bulkAddDriverTest
//{ ok: true, index: 2, value: 'Justin' }
/*
[{
"ok": true,
"id": "100",
"rev": "1-5190881ca746eca2ce205be647a4f87f"
}, {
"ok": true,
"id": "200",
"rev": "1-eb2b4d10bd0c17043509e8b7faeaa180"
}, {
"ok": true,
"id": "300",
"rev": "1-cf1c5d4190efc543698efa71eddb5b6e"
}, {
"ok": true,
"id": "400",
"rev": "1-5ed61ab3bd832d566f2ac4bf88f43870"
}, {
"ok": true,
"id": "500",
"rev": "1-7accb86cf6c167dc71e89f75e3a2ea25"
}]
*/
function bulkAddDriverTest(a, b) {
return function (err, res) {
// what a and b are without having to have a global
console.log("Notebook engaged!");
console.log("Is there an error?: " + JSON.stringify(err));
console.log("Is there a response ?: " + JSON.stringify(res));
if (err === a &&
res.ok === b.ok &&
res[b.index].firstName === b.value) {
console.log('response: ' + JSON.stringify(res))
console.log('success! Done.')
} else if (err === a &&
res.ok === b.ok &&
res.id !== b.id) {
console.log('Problem! Your document\'s _id does not equal ' + b.id)
}
else {
console.log('error! ' + JSON.stringify(err))
}
}
}
no comments