Import CSV to MongoDB

Use Withdata FileToMongo as CSV to MongoDB Converter (Importer / Loader)

Works GREAT in 2025.

Support Windows, Linux, and macOS.

Can run in GUI mode, Step by Step, just a few mouse clicks.

  1. 1 to 1: Import CSV to MongoDB collection
  2. n to 1: Import multiple CSV files to a single MongoDB collection
  3. n to n: Batch import CSV files to MongoDB collections

Can run in CLI (Command Line Interface), for Scheduled Tasks and Streams, for Automation.





Import CSV to MongoDB in GUI



Start Withdata FileToMongo, connect to MongoDB.

connect to mongodb



Import CSV to MongoDB collection

Click "1 File To 1 Collection" at task dialog.

Import file data To MongoDB collection - task window

Select the "CSV" file type.

Import CSV file data To MongoDB collection - select file type

1. Open a CSV file.

Import Data From CSV File To MongoDB collection - open CSV file

The source CSV file like this:

import CSV file to MongoDB collection - source CSV file

2. Set MongoDB collection options.

Load Data From CSV File To MongoDB collection - set collection options

3. Preview data will be in MongoDB collection.

Transfer Data From CSV File To MongoDB collection - preview

4. Import CSV data to MongoDB collection.

Copy Data From CSV File To MongoDB collection - import data

After importing, you can view imported data in MongoDB collection.

view MongoDB data



Import multiple CSV files to a single MongoDB collection

Click "N File To 1 Collection" at task dialog.

Import multiple CSV files data To a single MongoDB collection - task window

Select the "CSV" file type.

Import multiple CSV files data To 1 MongoDB collection - select file type

1. Open a folder contains CSV files.

Import multiple CSV files to 1 MongoDB collection - set CSV folder

2. Set CSV options.

Import multiple CSV Files To 1 MongoDB collection - config CSV file

3. Set MongoDB collection options.

Load multiple CSV Files To 1 MongoDB collection - select table

4. Preveiw data will be in MongoDB.

Transfer multiple CSV Files To 1 MongoDB collection - preview

5. Import multiple CSV files to a single MongoDB collection.

Copy multiple CSV Files To 1 MongoDB collection - import data

After importing, you can view imported data in MongoDB.

Import multiple CSV Files To Single MongoDB Collection - view data



Batch import CSV files to MongoDB collections

Click "N File To N Collection" at task dialog.

Batch Import CSV files data To MongoDB collections - task window

then show the wizard.

Select the "CSV" file type.

Batch Import CSV files data To MongoDB collections - select file type

1. Open a folder contains CSV files.

Batch Import Data From CSV Files To MongoDB collections - set CSV folder

2. Set CSV options.

Batch Import Data From CSV Files To MongoDB collections - config CSV file

3. List collesions, set "Import Type".

Batch Load Data From CSV File To MongoDB collections - select table

4. Map files to collections.

Batch Load Data From CSV File To MongoDB collections - select table

5. Summary.

Batch Transfer Data From CSV Files To MongoDB collections - preview

6. Import CSV data to MongoDB collections.

Batch Copy Data From CSV Files To MongoDB collections - import data

After importing, you can view imported data.

view MongoDB data

Set scheduled tasks for importing CSV to MongoDB

After importing CSV to MongoDB in Command Line, then you can schedule and automate "CSV to MongoDB" conversion task by:

  1. Save session and create .bat (Windows) or .sh (Linux/macOS) file for "CSV to MongoDB" conversion.
  2. Set scheduled task: On Linux/macOS, use Crontab. On Windows, use scheduled task.

FAQ

How long does it take to import CSV to MongoDB?

Is it safe to import CSV to MongoDB using FileToMongo?

Can I import CSV to MongoDB on Linux, Mac OS?

Can I import CSV to MongoDB in command line?

Can I batch import CSV files to MongoDB collections?