Skip to content

Documents import and export

agirbal edited this page Jun 12, 2011 · 2 revisions

File format

Files may be in the following formats:

  • BSON: documents are written in BSON (same as db) in sequence
  • JSON: documents are written in JSON format, one by line. This JSON format is extended compared to the one from mongoimport, and tries to maintain all special types.
  • JSON Array: same as JSON, but documents are in a JSON array instead of one by line. Only recommended for small datasets.
  • CSV: one document per line, represented as a comma-separated list of values. The first line of the file contains a comma-separated list of field names.

Result Set

Exporting a result set to a file

You can export any set of documents that is currently in a result tab.

  • Click on "Result / Export"
  • Pick the format and options

Important note: only the documents currently in the tab will be exported to the file, even if the result is a cursor. To save all documents from a cursor, do "Result / Get All" first.

Importing a result set from a file

  • Click on "Tools / Import File" in top menu

Collection

Exporting a collection to a file

All documents in the collection will be exported, although you can restrict the fields being saved.

  • Click on the Collection to export
  • On collection menu click on "Collection / Export"
  • Pick the format and options

Importing a file into a Collection

All documents in the collection in the file will be imported.

  • Click on the Collection to import to
  • On collection menu click on "Collection / Import"
  • Pick the format and options