In this exercise, you’ll create the scottish_info
database and then add the scottish_pubs
collection to the database. Next, you’ll export the query results you generated in Exercise 2 to the new collection.
To export the documents
1. In the Connection Tree, right-click the connection (top-level node) and click Add Database.
2. In the Add Database dialog box, type scottish_info in the Database Name text box, and then click OK.
Studio 3T adds the scottish_info database node to the Connection Tree.
3. Right-click the scottish_info database node and click Add Collection.
4. In the Add New Collection dialog box, type scottish_pubs in the Collection Name text box, and then click Create.
5. Return to the british_pubs collection tab and click Export on the toolbar to launch the Export Wizard.
6. On the Export source page, select the Current Query Result option and then click Next.
7. On the Select the export format page, select To another collection and then click Next.
8. On the Choose target collection page, click on Click here to connect to a server. This will open the Connection Manager dialog.
9. Select the target MongoDB connection from the list – which in our case is mongo1 – and then click Connect.
10. On the Choose target collection page, navigate to the scottish_pubs
collection in the scottish_info
database, and then click Finish.
11. This will open the Export unit #1 – To another collection tab. Review the export details and then click on Execute in the toolbar.
12. Go to the scottish_pubs
collection tab and click the Refresh button ()on the Result tab toolbar.
The Result tab should now display the first 50 imported documents.