UNPKG

dl

Version:

DreamLab Libs

37 lines (29 loc) 698 B
/*jslint node: true */ 'use strict'; var Batch = function() { this.operations = []; }; Batch.prototype.insert = function(table, key, columns, options) { var options = options || {}; this.operations.push({ name: 'insert', params: { table: table, key: key, columns: columns, ttl: options.ttl || null } }); }; Batch.prototype.remove = function(table, key, options) { var options = options || {}; this.operations.push({ name: 'remove', params: { table: table, key: key, columns: options.columns || null } }); }; exports.Batch = Batch;