作为一个新接触Mongo的人,我正在寻找一个可以导入和使用的示例MongoDB数据库。类似于mysql的world或MSSQL的Northwind。
有吗?(我在http://www.mongodb.org上找不到任何参考资料,我的谷歌搜索也没有帮助)
发布于 2011-05-19 17:54:55
我找到了this,您可以使用以下命令导入json数据:
mongoimport --db scratch --collection zips --file zips.json
我猜你可以导入你找到的任何json数据,它也支持csv和tsv。希望这能有所帮助。
发布于 2013-10-25 04:04:26
这并不是万能的,但这是让Northwind在MongoDB上迈出的一大步:
发布于 2015-09-22 16:38:24
从https://github.com/tmcnab/northwind-mongo/archive/master.zip下载Northwind csv文件集合
执行以下命令,将csv导入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
这可用于Windows和Liinux操作系统
https://stackoverflow.com/questions/5723896
复制相似问题