Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

165
Views
json2csv para objetos anidados

Estoy tratando de convertir mi registro en csv usando json2csv en nodejs, así es como se ve el registro:

 faqs: Record<string, any>; @Prop({ type: raw({ question: { type: String }, answerName: { type: String }, answer: { type: String }, status: { type: Boolean }, answers: { type: raw({ channels: { type: String }, answerParts: { type: raw({ type: { type: String }, data: { type: raw({ text: {type: String} }), required: false }, }), }, }), }, }), required: false, })

Y esto es lo que tengo hasta ahora, el problema es que el campo 'respuestas' no funciona porque es un campo anidado, ¿cómo puedo solucionar esto?

 const fields = ['question', 'answer', 'answerName','answers']; const parser = new Parser({ fields, unwind: ['question', 'answer', 'answerName','answers'], delimiter: ';', withBOM: true, });'

Además, también necesito transformar el campo 'respuesta' para que la segunda respuesta repetida tenga un # al principio, ¿es eso posible con esta biblioteca, tal vez con "transformaciones"?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!