Different from MySQL, it's pretty hard to find a FREE and full function GUI tool for MongoDB. We have tried three FREE popular MongoDB GUI.
In case you are looking for a FREE MongoDB GUI, here is a comparison of free vs paid of NoSQLBooster: https://nosqlbooster.com/compareEditions
We have been used to import CSV data into a MongoDB collection for a while, which works very well. But we got the error when importing JSON data. That might sound very weird, doesn't it? It ends up because we did not provide the "correct" JSON format. Let's see what JSON format to make NoSQLBooster happy.
Let's first look at the JSON data as below:
[{
"done": false,
"task": "write about nosqlbooster"
},
{
"done": false,
"task": "look for the best mongodb gui!"
}
]
We used https://jsonlint.com/ to make sure it's valid, and then we tried to import it into a collection.
Right click on a collection → Click on ‘Import Collection’ → Click on 'Mongoimport (JSON and CSV), and the the window open to allow us to choose the JSON file, but after we chose the validated JSON file, the popup window shown with the error message:
The specified file “xxx” is not valid mongoexport JSON file
Believe or not we could not find the answer by Googling this issue, but we found that we can import the JSON data if it contains only one record like:
{
"done": false,
"task": "write about nosqlbooster"
}
NoSQLBooster does not allow import multiple records? That does not sound right, we can always import CSV file without any issues. Finally we figured out that it does not like valid JSON data. Instead, we have to provide an invalid JSON data, like below:
{"done": false,"task": "write about nosqlbooster"}
{"done": false,"task": "look for the best mongodb gui!"}
You're right, no Array (i.e., []), no commas. Just need to write your records one by one.
That's it. Hope you find this helps until NoSQLBooster fixes this issue. :-)