libs/ingest-csv.js
function processFile(bucket, key, transform) {
  // get the csv file s3://${bucket}/${key}
  console.log(`Processing s3://${bucket}/${key}`)
  const s3 = new AWS.S3()
  const csvStream = csv.parse({ headers: true, objectMode: true })
  s3.getObject({Bucket: bucket, Key: key}).createReadStream().pipe(csvStream)
  return es.streamToEs(csvStream, transform, esClient, index)
}
function processFile(bucket, key, transform) {
  // get the csv file s3://${bucket}/${key}
  console.log(`Processing s3://${bucket}/${key}`)
  const s3 = new AWS.S3()
  const csvStream = csv.parse({ headers: true, objectMode: true })
  s3.getObject({Bucket: bucket, Key: key}).createReadStream().pipe(csvStream)
  return es.streamToEs(csvStream, transform, esClient, index)
}
function processFile ( bucket , key , transform ) { // get the csv file s3://${bucket}/${key} console . log ( ` ${ bucket } ${ key } ` ) const s3 = new AWS . S3 ( ) const csvStream = csv . parse ( { headers : true , objectMode : true } ) s3 . getObject ( { Bucket : bucket , Key : key } ) . createReadStream ( ) . pipe ( csvStream ) return es . streamToEs ( csvStream , transform , esClient , index ) }
Process single CSV file
Process single CSV file