stream-json
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
ale 2024-10-14 01:10:36 +02:00
parent 3c19b1c7bc
commit 6caf3d6d40

View File

@ -481,20 +481,21 @@ module.exports = (app, client) => {
parser(), parser(),
pick({ filter: 'hits.hits' }), pick({ filter: 'hits.hits' }),
streamArray(), streamArray(),
data => { data => data.value._source
block_count++
instancescomment.push({
instance: data.value._source.instance, comment: data.value._source.blocks.find(block => block.domain === clean(req.params.instance)).comment
})
}
]) ])
result.pipe(pipeline) pipeline.on('data', data => {
block_count++
instancescomment.push({
instance: data.instance, comment: data.blocks.find(block => block.domain === clean(req.params.instance)).comment
})
})
pipeline.on('end', () => { pipeline.on('end', () => {
res.json({ res.json({
block_count, block_count,
instances: instancescomment instances: instancescomment
}) })
}) })
result.pipe(pipeline)
} else { } else {
res.status(404).end() res.status(404).end()
} }