CSV to JSON for Database Import — MongoDB, Firebase
Quick Answer: Convert CSV data to a JSON array of documents for database import. Each CSV row becomes a JSON object. Use with mongoimport --jsonArray for MongoDB or the Firebase Admin SDK for Firestore batch writes.
Output will appear here...
FAQ
How do I import JSON into MongoDB?
Save the JSON array to a file and run: mongoimport --db mydb --collection mycol --jsonArray --file data.json. Or use insertMany() in mongosh.
How do I import JSON into Firebase?
For Realtime Database: import via Firebase Console or CLI. For Firestore: use the Admin SDK batch write. Convert each JSON object to a Firestore document with a unique ID.