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
mongodb
json
mongoimport -d tes
For windows bat file. This would be way better if you have a list of json files in the folder. and the collection name matches the name in files
@echo off for %%f in (*.json) do ( "mongoimport.exe" --db databasename --collection %%~nf --drop --file %%f ) pause