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(),
pick({ filter: 'hits.hits' }),
streamArray(),
data => {
data => data.value._source
])
pipeline.on('data', data => {
block_count++
instancescomment.push({
instance: data.value._source.instance, comment: data.value._source.blocks.find(block => block.domain === clean(req.params.instance)).comment
instance: data.instance, comment: data.blocks.find(block => block.domain === clean(req.params.instance)).comment
})
})
}
])
result.pipe(pipeline)
pipeline.on('end', () => {
res.json({
block_count,
instances: instancescomment
})
})
result.pipe(pipeline)
} else {
res.status(404).end()
}