I can run mongoimport from the commandline and get it to import a file if I hardcode the file name. mongoimport --host HOSTNAMEHERE --collection TESTColectionName --db DBNAME --file C:\FileFolder1\129871.json --jsonArray
The above works great but I have a folder with hundreds of.json files (that I do not know the names of). How can I iterate through all the files in the directory and import them into a mongodb?
I have written a few .js files to run mongo commands (find data, display data, print out the data, etc). Is there anyway I can iterate and run imports from here (I know mongoimport is a separate .exe from the mongo shell itself).
Let me know, Thank You