🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

@betterthings/reset-es-data

Package Overview
Dependencies
Maintainers
2
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@betterthings/reset-es-data

reset elasticsearch data

latest
Source
npmnpm
Version
0.0.1
Version published
Weekly downloads
1
Maintainers
2
Weekly downloads
 
Created
Source

Reset Elasticsearch Data

⚠️ Attention: there are no tests and it was created at 2am

A utility to index and reset the data in your local Elasticsearch based on a certain directory structure. It can be used to reset the database during local development / testing.

Important: Elasticsearch needs to listen at localhost:9200.

reset-es-data takes the data directory of the current working directory and does the following:

  • for each data/<index> folder it first deletes and then creates the index <index> with the mapping stored in data/<index>/_mapping.json
  • for each data/<index>/<type>/<id>.json file it indexes the document

Running the tool at the following directory structure will create the index users and add alice and bob to the users/default type.

data
  users
    _mapping.json
    default
      alice.json
      bob.json

Authors

  • Florian Hämmerle (@lusbuab) - Better Things Digital

Keywords

elasticsearch

FAQs

Package last updated on 22 Nov 2018

Did you know?

Socket

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.

Install

Related posts