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

261
Views
How to restrict text in one column if the text is having multiple commas while generating csv throigh mongo command
In the JSON commas were there in the remarks column text so when we execute mongo command ,in the csv file ,remarks was going to the multiple cells.Can we restrict whole remarks column should be in one cell?

mongo dbEntityDB dbEntity.js > out.csv

db.dbEntity.insertOne( 
{
    "employee": {

        
        "employeeId": "46363366",
        "name": "wrwr",
        "remarks": "abcd,efgh"
        

    }
}
)


dbEntity.js
************

print("employeeId,name,remarks");

cursor=db.dbEntity.find();


let out="";

while(cursor.hasNext()){
    
    
    jsonobj=cursor.next();
    
    employeeId =    jsonobj.employee.employeeId;
    name =    jsonobj.employee.name;
    remarks =    jsonobj.employee.remarks;
    
    out =out+ employeeId +","+name +","+customerName+","+remarks+"\n";
    
};

print(out)
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!