Search code examples
mongodbstudio3t

Import dataset into MongoDB


I am trying to insert this database into MongoDB using Studio 3T. I can import the bson without any issues (the countries and timezones) by selecting the parent folder and using BSON - mongodump folder option. However I cannot figure out how to import the split cities dataset.

I have tried all the options available on Studio3T and attempted to change the filename to gz however it always fails to import. I don't know what file format the cities are in.

Normally I do not have any issue importing but I cannot figure out how to do this. How would I achieve this?

The source DB is here https://github.com/VinceG/world-geo-data

enter image description here


Solution

  • This data is nothing but a big .bson file that has been gzipped up and split into various parts. I was not able to import the .bson file successfully. However, I could unzip the file at least without an error using the following commands and GZip for Windows

    copy /b city_split_aa+city_split_ab+city_split_ac+city_split_ad+city_split_ae cities.bson.gz
    gzip -d cities.bson