I am trying to import json using bash script but it does not seem to be working properly
The error that I am getting is: error validating settings: incompatible options: --file and positional argument(s)
Here is the script that I am trying to run
importserver="localhost:27017"
username="username"
password="password"
importdb="Hotel"
collections=("Customers")
echo "Begin To Import"
for c in ${collections[@]}
do
echo "importing $c .."
mongoimport $importserver --db $importdb --collection $c --file "$c.json"
done
echo "Done."
I have tried changing params and everything. None seems to work