Import a CSV file, using the first line of the file to determine field names

mongoimport

  • Imports content from a JSON, CSV, or TSV file into a MongoDB database.
    More information: <https://docs.mongodb.com/database-tools/mongoimport/>.
  • Trick copyright: tl;dr; <https://github.com/tldr-pages/tldr>

mongoimport --type={{csv}} --file={{path/to/file.csv}} --db={{database_name}} --collection={{collection_name}}

click the source code to copy install mongoimport on any operating system with command-not-found.com