Mongodb Compass UI Import and Export JSOn and CSV with steps

MongoDB Compass provides an Option to import and export JSON files

How to Export Collections as CSV or JSON in MongoDB Compass

  • Open MongoDB Compass and connect to Server
  • Open a collection that you want to export
  • It lists all documents. Click on the Export Data Option, Select either
    • Export query Results: Search results with filter and query options
    • Export full collection: All documents are selected
Mongodb Compass Export Collection
  • Select the Export Full collection option, It shows a Popup window to select file type JSON or CSV.
Mongodb Compass UI query Export JSON or CSV
  • There is an Advanced JSON Format option for JSON which has Default Extended JSON & Relaxed Extended JSON & Canonical Extended JSON. You can check more here🔗 Selected JSON and click on Export - It asks the JSon file location to save - Finally, save the json object. - The same case, for CSV, saved as CSV file for file type as CSV.

How to Export Collections as CSV or JSON in MongoDB Compass

  • Open MongoDB Compass and connect to Server
  • Open a collection that you want to import
  • Click on ADD Data and show two options
    • Import JSON or CSV file
    • Insert document: Manually insert a document
Mongodb Compass UI import or insert manually
  • On selecting Import JSON or CSV file, It asks for file location

  • Select the file, Click on Import

  • It imports documents from JSOn file into collection successfully