如何使用mongoimport将大型json文件导入mongodb?

时间:2014-07-02 17:17:32

标签: mongodb mongoimport

我正在尝试使用mongoimport将大型数据集json文件导入mongodb。

mongoimport --db test --collection sam1 --file 1234.json --jsonArray

error:
2014-07-02T15:57:16.406+0530 error: object to insert too large
2014-07-02T15:57:16.406+0530 tried to import 1 objects

2 个答案:

答案 0 :(得分:7)

请尝试添加此选项: - batchSize 1

像:

mongoimport --db test --collection sam1 --file 1234.json --batchSize 1

答案 1 :(得分:-2)

有一个实施

https://github.com/rootstock/ethereumj/tree/web3

公开web3界面