To import data into a database, click with the right mouse button on the database name and selects the entry "import records" in the context menu. It is possible to import individual documents or entire collections in the database. This can be done via drag & drop using file or by direct text input, as shown in the figure shown below. In both cases, the formatting of the data is to be observed, otherwise the import will fail.
File-Import
With this option the import of the data is executed via a JSON file. Choose "import records from file" in import-popup to select this option.
Hinweis |
---|
The documents in the JSON file must be formatted according to the mongoexport function of MongoDB. This means that a file created by mongoexport can be imported in Mongo Management Studio. |
Based the import of the data on the database level, the name of the destination collection must be specified. The import mode determines whether to add documents to existing data or whether the collection should be emptied prior to importing. The "Drop duplicate keys" option determines the behavior when importing documents whose id field is equal to the id field of existing documents. If this option is enabled, those documents will be ignored and the import is be processed. Otherwise the import operation aborts. The file can be imported either via drop drag and drop in the appropriate field or by using the "Select Files" button to select the file from the file system. Click on the button "Import" starts the import.
Text-Import
For the import of documents via text input choose the option "Import documents from textbox" as source. The data you input in the text box must be valid JSON data, which are located within an array. The remaining options are analogous to the File Import.
Hinweis |
---|
The import process can take some time. It is therefore advisable to access mongoimport for larger amounts of data. |