Is there a sample MongoDB database worldwide for MySql?

As someone new to Mongo, I am looking for a sample MongoDB database that I can import and play with. Something like world for mysql or Northwind for MSSQL.

Is he there? (I could not find links to one at http://www.mongodb.org , and also did not help me in the search engine)

+56
mongodb
Apr 19 '11 at 23:23
source share
8 answers

For * NIX / Mac OS, this can be done in two simple steps.

wget http://media.mongodb.org/zips.json mongoimport -v --file=zips.json 

For Windows users: To import from a json file, if you are using Windows 7, follow these steps:

  • Download the above JSON file and put it in a folder (say d:\sample )
  • Open a command prompt, start the mongo server by going to the bin directory and enter mongoD
  • Now run another command line and again go to the bin directory and write the following command

    C:\mongodb\bin>mongoimport --db test --collection zips --file d:\sample\zips.json

  • Import should start working immediately, and in the end it should show something like this: Thu Dec 19 17:11:22 imported 29470 objects

What is it!

+35
Dec 13 '12 at 12:59
source share

I found this , you can import json data with:

 mongoimport --db scratch --collection zips --file zips.json 

I assume you can import any json data you find, and also supports csv and tsv. Hope this helps.

+51
May 19 '11 at 9:54 am
source share

This does not have everything, but it is a good step towards getting Northwind on MongoDB:

https://github.com/tmcnab/northwind-mongo

+17
Oct 24 '13 at 20:04 on
source share

Download the Northwind csv file collection from https://github.com/tmcnab/northwind-mongo/archive/master.zip

Run the following command to import csv to mongodb

 mongoimport -d Northwind -c categories --type csv --file categories.csv --headerline mongoimport -d Northwind -c customers --type csv --file customers.csv --headerline mongoimport -d Northwind -c employee-territories --type csv --file employee-territories.csv --headerline mongoimport -d Northwind -c employees --type csv --file employees.csv --headerline mongoimport -d Northwind -c northwind --type csv --file northwind.csv --headerline mongoimport -d Northwind -c order-details --type csv --file order-details.csv --headerline mongoimport -d Northwind -c orders --type csv --file orders.csv --headerline mongoimport -d Northwind -c products --type csv --file products.csv --headerline mongoimport -d Northwind -c regions --type csv --file regions.csv --headerline mongoimport -d Northwind -c shippers --type csv --file shippers.csv --headerline mongoimport -d Northwind -c suppliers --type csv --file suppliers.csv --headerline mongoimport -d Northwind -c territories --type csv --file territories.csv --headerline 

This can be used for both Windows and Liinux OS.

+8
Sep 22 '15 at 8:38
source share

After loading Northwind data according to @tslater, I cleaned it a bit.

And ran the following PowerShell command to import into mongo:

 Get-ChildItem "C:\MongoDb\samples\northwind\csv" -Filter *.csv | ` Foreach-Object { C:\MongoDb\bin\mongoimport.exe -h localhost:55000 -d northwind -c $_.BaseName --type csv --file $_.FullName --headerline } 
+7
Feb 20 '14 at 20:58
source share

http://docs.mongodb.org/manual/tutorial/aggregation-zip-code-data-set/ provides the json file at the link: http://media.mongodb.org/zips.json , which is the zip code data .

This can be used for training on map reduction, aggregation and grouping of queries, and the link to the MongoDB tutorial above also shows how.

For Windows: you can install the MongoVUE tool (from http://www.mongovue.com ), which is an IDE for MongoDB shell operations, and also provides a -Reduce, Aggregation and Filtering map, and also import data from MySQL databases into MongoDB .

In the JSON file at the above link, there are 3 _id duplicate entries that will interfere with the import process a bit, and you may have to remove removeall for the inserted documents. But in the end, you should have 29,467 documents in your collection.

MongoVUE IDE after the import

+3
Feb 19 '14 at 12:30
source share

You can create TPC-H and import them.

Import example for lineitem table:

 ./mongoimport -d test -c lineitem --type csv -f l_orderkey,l_partkey,l_suppkey,l_linenumber,l_quantity,l_extendedprice,l_discount,l_tax,l_returnflag,l_linestatus,l_shipdate,l_commitdate,l_receiptdate,l_shipinstruct,l_shipmode,l_comment --file /home/metdos/mongo/tpc-h/tpch_2_13_0/lineitem.tbl 
+2
Oct. 13
source share

I update my movie collection when I get free time. Personally, this is very useful for me, because it contains an inline object, an array field, a string field, a date field. Click here to get a JSON movie collection file

One document demonstration

 { "_id" : ObjectId("5692a15524de1e0ce2dfcfa3"), "title" : "Toy Story 4", "year" : 2011, "rated" : "G", "released" : ISODate("2010-06-18T04:00:00.000Z"), "runtime" : 206, "countries" : [ "USA" ], "genres" : [ "Animation", "Adventure", "Comedy" ], "director" : "Lee Unkrich", "writers" : [ "John Lasseter", "Andrew Stanton", "Lee Unkrich", "Michael Arndt" ], "actors" : [ "Tom Hanks", "Tim Allen", "Joan Cusack", "Ned Beatty" ], "plot" : "The toys are mistakenly delivered to a day-care center instead of the attic right before Andy leaves for college, and it up to Woody to convince the other toys that they weren't abandoned and to return home.", "poster" : "http://ia.media-imdb.com/images/M/MV5BMTgxOTY4Mjc0MF5BMl5BanBnXkFtZTcwNTA4MDQyMw@@._V1_SX300.jpg", "imdb" : { "id" : "tt0435761", "rating" : 8.4, "votes" : 500084 }, "tomato" : { "meter" : 99, "image" : "certified", "rating" : 8.9, "reviews" : 287, "fresh" : 283, "consensus" : "Deftly blending comedy, adventure, and honest emotion, Toy Story 3 is a rare second sequel that really works.", "userMeter" : 89, "userRating" : 4.3, "userReviews" : 602138 }, "metacritic" : 92, "awards" : { "wins" : 56, "nominations" : 86, "text" : "Won 2 Oscars. Another 56 wins & 86 nominations." }, "type" : "movie", "reviews" : [ { "date" : ISODate("2017-02-13T04:00:00.000Z"), "name" : "parvesh", "rating" : 8.9, "comment" : "My first review for Toy Story 3, hoping it will execute while trying for the very first time." }, { "date" : ISODate("2017-02-13T04:00:00.000Z"), "name" : "Prabhash", "rating" : 9.3, "comment" : "My second review for Toy Story 3, hoping it will execute while trying for the very first time." }, { "date" : ISODate("2017-02-11T04:00:00.000Z"), "name" : "praveen", "rating" : 6.7, "comment" : "My third review for Toy Story 3, hoping it will execute while trying for the very first time." } ] } 
+1
Feb 22 '17 at 9:25
source share



All Articles