New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

elasticsearch-loop

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

elasticsearch-loop

  • 0.3.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7
decreased by-75.86%
Maintainers
1
Weekly downloads
 
Created
Source

Elasticsearch loop

Elasticsearch Loop is package are made your elasticsearch full paging loop is easier. Just few line of code you could loop all paging and take action with your data in elasticsearch

Installation

npm install elasticsearch-loop

Example

var elasticLoop = require("elasticsearch-loop");

// Connect Elasticsearch
elasticLoop.connect({
    host: 'localhost:9200'
});

//Remove comment when you want to debug
//elasticLoop.debugMode();

elasticLoop.query({
        index: 'main',
        q: 'time:[2016-01-01 TO 2016-12-31]',
},function(data){
    //What do you want to do with each data.
},function(data){
    //What do you want to do when your loop is success finish.
},function(data){
    //What do you want to do when query is error.
});

Example (Promise Based)

var elasticLoop = require("elasticsearch-loop/es");

// Connect Elasticsearch
(async () => {
  const connect = elasticLoop.connect({
    host: 'localhost:9200'
  })
  const res = await connect.query({
    index: 'main',
    q: 'time:[2016-01-01 TO 2016-12-31]',
  })
  console.log(res)
})()

Remark

  • This library is using scan & score method
  • Query and connection parameter reference from https://github.com/elastic/elasticsearch-js

FAQs

Package last updated on 15 Jun 2020

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc