ductile
Version:
Elasticsearch Bulk Loader
25 lines (22 loc) • 602 B
JavaScript
// Generated by CoffeeScript 1.11.1
(function() {
module.exports = function(client) {
return function(bulk, callback) {
return bulk.reduce(function(p, c) {
return p.then(function() {
var t;
t = c.template;
return client.indices.putTemplate({
name: t._name,
body: t._template
});
});
}, Promise.resolve()).then(function() {
return callback(null, {});
})["catch"](function(err) {
return callback(err);
});
};
};
}).call(this);
//# sourceMappingURL=write-template.js.map