How to efficiently import many large JSON files directly from S3 into MongoDB

前端 未结 2 1707
忘了有多久
忘了有多久 2021-02-06 10:25

I have compressed JSON files in S3 and I would like to set up MongoDB in EC2 to server json documents contained in these files. The compressed files are >100M and there are 1000

2条回答
  •  悲哀的现实
    2021-02-06 10:59

    The alternative of using s3cmd is to use aws s3 which has fewer features but comes installed with AWS CLI.

    The command would look like:

    aws S3 cp  - | \
    mongoimport \
    --db  \
    --collection  \
    

    The - sends the file to stdout

提交回复
热议问题