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

elasticsearch-scroll-stream

Package Overview
Dependencies
Maintainers
2
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

elasticsearch-scroll-stream - npm Package Compare versions

Comparing version 1.3.1 to 1.3.2

2

lib/elasticsearch-stream.js

@@ -44,3 +44,3 @@ const { Readable } = require('stream')

body.hits.hits.forEach(hit => {
let ref_results = hit.fields ? hit.fields : hit._source
let ref_results = hit.fields ? hit.fields : hit._source || {}

@@ -47,0 +47,0 @@ // populate extra fields

{
"name": "elasticsearch-scroll-stream",
"version": "1.3.1",
"version": "1.3.2",
"description": "Elasticsearch Scroll query results as a Stream",

@@ -5,0 +5,0 @@ "repository": {

@@ -200,2 +200,51 @@ /**

it("Should stream correctly when '_source' property is false", function (done) {
this.timeout(10000)
let counter = 0
let current_doc
let elasticsearch_client = new Client({ node: 'http://localhost:9200' })
let es_stream = new ElasticsearchScrollStream(
elasticsearch_client,
{
index: 'elasticsearch-test-scroll-stream',
type: 'test-type',
scroll: '10s',
size: '50',
_source: false,
body: {
query: {
bool: {
must: [
{
query_string: {
default_field: '_all',
query: 'name:third*',
},
},
],
},
},
},
},
['_id']
)
es_stream.on('data', function (data) {
expect(es_stream._total).to.equal(20)
current_doc = JSON.parse(data.toString())
expect(current_doc).to.have.property('_id')
counter++
})
es_stream.on('end', function () {
expect(counter).to.equal(20)
done()
})
es_stream.on('error', function (err) {
done(err)
})
})
it('Should throw error when optional_fields is not an array', function (done) {

@@ -202,0 +251,0 @@ let elasticsearch_client = new Client({ node: 'http://localhost:9200' })

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