Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
es-bulk-update-builder
Advanced tools
Readme
Bulk update request body builder for Elasticsearch
$ npm install --save es-bulk-update-builder
Usage is basically as follows:
const BulkUpdateBuilder = require('es-bulk-update-builder');
const body = new BulkUpdateBuilder()
.index({ name: 'my-doc' }, 'some-index', 'some-type', 'some-id', 3)
.update({ name: 'other-doc' }, 'other-index', 'other-type', 'other-id', 4)
.delete('another-index', 'another-type', 'another-id', 5)
.build();
// The body variable can now be passed to the JavaScript elasticsearch client, e.g.:
// client.bulk({ body: body });
The index
method is for adding a document, the update
method is for updating a document, and the delete
method is for deleting a document.
For each action you can specify a version number, for example 3
in the following example:
const body = new BulkUpdateBuilder()
.index({ name: 'my-doc' }, 'some-index', 'some-type', 'some-id', 3);
If you do specify a version, the version type is set to external
. You can override that by specifying the desired version type, which in the following example is external_gte
:
const body = new BulkUpdateBuilder()
.index({ name: 'my-doc' }, 'some-index', 'some-type', 'some-id', 3, 'external_gte');
To specify no versioning information, simply omit it:
const body = new BulkUpdateBuilder()
.index({ name: 'my-doc' }, 'some-index', 'some-type', 'some-id');
FAQs
Bulk update request body builder for Elasticsearch
The npm package es-bulk-update-builder receives a total of 0 weekly downloads. As such, es-bulk-update-builder popularity was classified as not popular.
We found that es-bulk-update-builder demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.