You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

elasticsearch-doc-stream

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

elasticsearch-doc-stream

read stream of elasticsearch documents

1.0.0
latest
npmnpm
Version published
Weekly downloads
8
166.67%
Maintainers
1
Weekly downloads
 
Created
Source

elasticsearch-doc-stream

A read stream of elasticsearch documents. Handy for reporting.

var docStream = require('elasticsearch-doc-stream');

var users = [];

var d = docStream({
  url: 'http://localhost:9200/test',
  search: {
    query: {
      match: {
        title: "elasticsearch"
      }
    }
  }
});

d.on('data', function (doc) {
  var user = doc._source.user;
  if (users.indexOf(user) === -1) {
    users.push(user);
  }
});

d.on('error', function (err) {
  console.error(err);
});

d.on('end', function () {
  console.log(users);
});

FAQs

Package last updated on 04 Apr 2015

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