{"id":16315,"date":"2024-01-18T16:18:12","date_gmt":"2024-01-18T16:18:12","guid":{"rendered":"http:\/\/www.withdata.com\/blog\/?p=16315"},"modified":"2025-10-13T09:10:56","modified_gmt":"2025-10-13T09:10:56","slug":"3-ways-to-import-data-from-files-csv-tsv-json-into-mongodb-without-coding","status":"publish","type":"post","link":"https:\/\/www.withdata.com\/blog\/filetomongo\/3-ways-to-import-data-from-files-csv-tsv-json-into-mongodb-without-coding.html","title":{"rendered":"3 ways to import data from files (CSV, TSV, JSON) into MongoDB without coding"},"content":{"rendered":"<p>Sometimes, you need to import data from files, CSV, JSON, or other types, to MongoDB collections, here are some tools you can use. All supports Atlas.<\/p>\n<h2>1. mongoimport<\/h2>\n<p><a href=\"https:\/\/www.mongodb.com\/docs\/database-tools\/mongoimport\/\">https:\/\/www.mongodb.com\/docs\/database-tools\/mongoimport\/<\/a><\/p>\n<p>mongoimport is a powerful command-line tool for importing data from JSON, CSV, and TSV files into MongoDB collections.<\/p>\n<h3>MongoDB Import JSON<\/h3>\n<p><code>mongoimport --host=mongodb1.example.net --port=37017 --username=user --collection=contacts --db=marketing --file=\/opt\/backups\/mdb1-examplenet.json<\/code><\/p>\n<h3>MongoDB Import CSV,TSV<\/h3>\n<p><code>mongoimport --db=users --collection=contacts --type=csv --headerline --file=\/opt\/backups\/contacts.csv<\/code><\/p>\n<h2>2. MongoDB Compass<\/h2>\n<p><a href=\"https:\/\/www.mongodb.com\/docs\/compass\/current\/\">https:\/\/www.mongodb.com\/docs\/compass\/current\/<\/a><\/p>\n<p>MongoDB Compass is a powerful GUI for querying, aggregating, and analyzing your MongoDB data in a visual environment.<br \/>\nYou can use MongoDB Compass to import and export data to and from collections. Compass supports import and export for both JSON and CSV files.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.mongodb.com\/docs\/compass\/current\/images\/compass\/import-csv-options.png\" alt=\"MongoDB Compass\" \/><\/p>\n<p>for details: <a href=\"https:\/\/www.mongodb.com\/docs\/compass\/current\/import-export\/\">https:\/\/www.mongodb.com\/docs\/compass\/current\/import-export\/<\/a><\/p>\n<h2>3. WithData FileToMongo<\/h2>\n<p><a href=\"https:\/\/withdata.com\/file-to-mongo\/\">https:\/\/withdata.com\/file-to-mongo\/<\/a><\/p>\n<p>FileToMongo is a data conversion software that helps you to import File (TXT, CSV, TSV, EXCEL, JSON, XML, SQL, INI, RDF, LOG) data to MongoDB. Support all MongoDB deployment types: standalone, replica set, sharded cluster, and MongoDB Atlas.<\/p>\n<p>Support Windows, Linux, and macOS.<\/p>\n<p>Can run in GUI and CLI mode.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.withdata.com\/images\/filetomongo\/wizard-import-file-source-file-csv.png\" alt=\"FileToMongo import CSV to MongoDB\" width=\"724\" height=\"573\" style=\"max-width:100%;height:auto;display:block;\" \/><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.withdata.com\/images\/filetomongo\/wizard-import-convert-csv.png\" alt=\"import CSV to MongoDB\" width=\"724\" height=\"573\" style=\"max-width:100%;height:auto;display:block;\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>For details:<\/p>\n<h3>Import CSV file to MongoDB collection<\/h3>\n<p><a href=\"https:\/\/www.withdata.com\/tools\/file-to-mongodb\/csv-to-mongodb\">https:\/\/www.withdata.com\/tools\/file-to-mongodb\/csv-to-mongodb<\/a><\/p>\n<h3>Import JSON file to MongoDB collection<\/h3>\n<p><a href=\"https:\/\/www.withdata.com\/tools\/file-to-mongodb\/json-to-mongodb\">https:\/\/www.withdata.com\/tools\/file-to-mongodb\/json-to-mongodb<\/a><\/p>\n<p>more:<br \/>\n<a href=\"https:\/\/www.withdata.com\/tools\/file-to-mongodb\/tsv-to-mongodb\">Import TSV to MongoDB<\/a><br \/>\n<a href=\"https:\/\/www.withdata.com\/tools\/file-to-mongodb\/excel-to-mongodb\">Import Excel to MongoDB<\/a><br \/>\n<a href=\"https:\/\/www.withdata.com\/tools\/file-to-mongodb\/xml-to-mongodb\">Import XML to MongoDB<\/a><br \/>\n<a href=\"https:\/\/www.withdata.com\/tools\/file-to-mongodb\/sql-to-mongodb\">Import SQL to MongoDB<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes, you need to import data from files, CSV, JSON, or other types, to MongoDB collections, here are some tools you can use. All supports Atlas. 1. mongoimport https:\/\/www.mongodb.com\/docs\/database-tools\/mongoimport\/ mongoimport is a powerful command-line tool for importing data from JSON, CSV, and TSV files into MongoDB collections. MongoDB Import JSON mongoimport &#8211;host=mongodb1.example.net &#8211;port=37017 &#8211;username=user &#8211;collection=contacts [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1707],"tags":[],"class_list":["post-16315","post","type-post","status-publish","format-standard","hentry","category-filetomongo"],"_links":{"self":[{"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/posts\/16315","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/comments?post=16315"}],"version-history":[{"count":7,"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/posts\/16315\/revisions"}],"predecessor-version":[{"id":40182,"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/posts\/16315\/revisions\/40182"}],"wp:attachment":[{"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/media?parent=16315"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/categories?post=16315"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/tags?post=16315"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}