Import more than 1 json file using mongoimport

前端 未结 12 1443
猫巷女王i
猫巷女王i 2020-11-30 00:27

I am new to mongodb and want to know about importing a json file from one server to another. I tried the following command mongoimport -d tes

12条回答
  •  囚心锁ツ
    2020-11-30 00:40

    You can always write some shell scripts.

    colls=( mycoll1 mycoll2 mycoll5 )
    
    for c in ${colls[@]}
    do
      mongoimport -d mydb -c $c.json
    done
    

提交回复
热议问题