#!/bin/bash
# NOTE: Follow instructions at https://docs.mongodb.com/guides/server/import/  (click on "Cloud" deployment type)
#       Then use the sample import values below
# USAGE: mongoload db_name collection_name file_with_json_array

USERNAME=YOUR_USERNAME
PASSWORD=YOUR_PASSWORD
HOST="Cluster0-shard-0/ ... long string from instruction link above"

if [ $# -ne 3 ]
	then
		echo "Usage: mongoload db_name collection_name file_with_json_array"
		exit 1
fi

mongoimport --host $HOST --ssl --username $USERNAME --password $PASSWORD --authenticationDatabase admin --db $1 --collection $2 --file $3 --type json --jsonArray
