for filename in *; do mongoimport -d mydb -c $filename; done
如果你在Windows上:
FOR %i IN (C:\mongodbData\*.json) DO mongoimport --db dbName --collection colection --type json --file %i