I am faced with the task of loading multiple js
files that contain collections creations and seeds into my database using the mongo
command. Currently, I have been manually loading data from each file one by one like so:
mongo <host>:<port>/<database> -u <user> -p <password> < db.users.js
However, as the number of files increases, I am looking for a more efficient way to load all of them at once into mongo
, preferably using the mongo
shell. Is there a streamlined method to accomplish this?