batchSet
写入一批数据
/**
* Batch Set value
* @param {String} tableName
* @param {Array} argsArray
* {Buffer} argsArray[i].hashKey required
* {Buffer} argsArray[i].sortKey required
* {Buffer} argsArray[i].value required
* {Number} argsArray[i].ttl optional
* {Number} argsArray[i].timeout(ms) optional
* @param {Function} callback
* @throws{InvalidParamException} callback is not function
*/
client.batchSet(
tableName,
argsArray,
function(err, result){
// err will be always be null, result is {'error': err} array
// if batchSet[i] operation succeed, result[i].error will be null
// else result[i].error will be instance of PException
}
);
- batchSet操作的必填参数为表名,hashKey-sortKey-value对象数组和callback
- callback的err总是为null,result[i].error表示第i个set操作的出错情况