I have a react project with nodejs mongodb and I use csvparser to transform data from a csv table into data in my database, I noticed that the first key of my table is necessarily between coast for example :
fs.createReadStream(filePath)
.pipe(csv({ separator: ';' }))
.on('data', (data) => {
console.log(data)
Here's the answer :
{
'Bookmaker': 'Unibet',
Tipster: '',
Sport: 'Football',
Categorie: '',
Competition: '',
Type_de_pari: '',
Pari_gratuit: '',
Live: '',
Type: 'Simple',
Intitule_du_pari: 'Montpellier - Lille : Plus de 1,5 buts',
Cote: '1.35',
Mise: '50',
Gain: '-50',
Bonus_de_gain: '',
Commission: '',
Benefice: '-50',
Etat: 'Perdu',
Closing_Odds: '',
Commentaire: ''
}
And from then on I can't access the bookmaker value because neither console.log(data.Bookmaker) nor console.log(data.['Bookmaker'] work. How can I retrieve the bookmaker values?