Withdata Software

Import XML file to MongoDB collection

Want to import data from XML file to MongoDB collection?

Using FileToMongo, a native GUI tool, you can import data from XML file to MongoDB collection easily and fast, no need to program, just a few mouse clicks!

Support all MongoDB deployment types: standalone, replica set, sharded cluster, and MongoDB Atlas.

Support Windows, Linux, macOS.

Here’s how to.

Example

Example source XML file

After importing, data in the collection

Import

Please download and install FileToMongo, then run it.

Click “1 File To 1 Collection” at task dialog.

Select the “XML” file type.

1. Open a XML file.

2. Set MongoDB collection options.

3. Summary.

4. Import XML data to MongoDB collection.

After importing, you can view imported data.

Save/load session

You can save/load session to run “XML to MongoDB collection” conversion repeatly.

1.Save Session.

Click “Save Session” button, then enter a session file name.

click “OK” button.

2.Load Session.

Click the “Open a Saved Session” in task window, select a session file.

then show the wizard form, click a few “Next” to import XML to MongoDB collection.

Run in command line

You can run “XML to MongoDB collection” conversion in command line.

When you save session, you can click “Save & Make Batch File”.

The “Save & Make Batch File” form shows.

Click “OK” button, you’ll create a batch file, in Windows, like this:

C:
cd "C:\Users\pansh\AppData\Local\Programs\FileToMongo"
FileToMongo task="C:\Users\pansh\Documents\test.mlf" logfile="C:\Users\pansh\Documents\test.log"

You can run this batch file in command line.

Run as scheduled task

You can run “XML to MongoDB collection” conversion automatically at specific time.

On Linux/macOS, you can use Crontab.

For macOS, How to Fix Cron Permission Issues in macOS.

On Windows, in “Save & Make Batch File” form, you can click “Create & Schedule Task” to set a scheduled task.

And then, with scheduled task wizard, step by step.

You’ll see created task listed in scheduled task list.

Download

Here you can download FileToMongo, and buy FileToMongo.

Download FileToMongo