Socket
Socket
Sign inDemoInstall

proc-that-elastic-loader

Package Overview
Dependencies
16
Maintainers
7
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    proc-that-elastic-loader

Loader for proc-that. Loads processed items into an elasticsearch index.


Version published
Maintainers
7
Install size
12.0 MB
Created

Readme

Source

ElasticLoader

Loader for proc-that. Loads processed items into an elasticsearch index.

A bunch of badges

Build Status Build Status npm Coverage status license semantic-release Greenkeeper badge

Installation

npm install --save proc-that-elastic-loader

Usage

import {Etl} from 'proc-that';
import {ElasticLoader} from 'proc-that-elastic-loader';

let loader = new ElasticLoader({/*es-config*/}, 'index', 'type');

new Etl().addLoader(loader).start().subscribe(/*...*/);

Custom id selector

If your object does not have the property "id" or you need to select a different property for item identification, you can set the last constructor parameter idSelector and use a custom function.

import {Etl} from 'proc-that';
import {ElasticLoader} from 'proc-that-elastic-loader';

let loader = new ElasticLoader({/*es-config*/}, 'index', 'type', o => true, obj => obj.notDefaultId);

new Etl().addLoader(loader).start().subscribe(/*...*/);

Predicate

If you process multiple item types and your items are not stored into the same index or the same index type, you can use the predicate param to filter the items that are indexed by the loader. In the example below, all items with .type === 'Type1' are only processed by type1Loader and vice versa.

import {Etl} from 'proc-that';
import {ElasticLoader} from 'proc-that-elastic-loader';

let type1Loader = new ElasticLoader({/*es-config*/}, 'index', 'type_1', obj => obj.type === 'Type1');
let type2Loader = new ElasticLoader({/*es-config*/}, 'index', 'type_2', obj => obj.type === 'Type2');

new Etl().addLoader(type1Loader).addLoader(type2Loader).start().subscribe(/*...*/);

Keywords

FAQs

Last updated on 20 Dec 2022

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc