I am looking for a way to create a new database and a collection using only the terminal, without using Mongo shell or Mongo Compass GUI.
The idea is to create the db and collection from the terminal before using mongoimport, like:
# Create database `company-example` and collection `employees` from the terminal
# ...
# ...
# Import the data to the collection
mongoimport --db=company-example --collection=employees --file=employees.json --jsonArray
I could create a npm package and run it with with Node from the terminal, but I am wondering if there is a simpler way?
mongoimport.... I updated the question