Closed matt212 closed 6 years ago
You'd need to do something like the following:
var Transform = require('stream').Transform
function transform(chunk, encoding, callback) {
this.push({"index":{"_index":"tvseries","_type":"internindex"}})
callback(null, chunk)
}
streams
.pipe(new Transform({objectMode : true, transform: transform}))
.pipe(JSONStream.stringify()).pipe(stream)
PS: code is not tested, just written to demonstrate the idea.
thanks a lot @Poetro , sure will try this approach and provide an feedback accordingly !
Hi, i wanted to append below object to every object in stream
my stream looks like this
what my stream should look like !
how can i achieve this using jsonstream in my existing belowcodebase