In this exercise, you will execute the queries you created in the second exercise.
As part of this process, you will use several IntelliShell features to run the queries and view the results in different formats.
To run the queries and view the results
1. On the IntelliShell tab, position your cursor after the third command in the editor – db.bios.find({contribs:"ALGOL"}).pretty();
– which is the last command you created in the previous exercise.
Click the Run statement at cursor button () on the toolbar.
The result tab should show two documents, both containing ALGOL
as a contribs
value.
The following figure shows the first document included in the results.
Notice that the tab is named Raw Shell Output. This is the name assigned to the tab when Query Assist is disabled.
With Query Assist disabled, all results appear in the Raw Shell Output tab, regardless of the type of query.
Whenever possible, Studio 3T will parse documents from the Raw Shell Output and display them in a “prettier” Shell Output (Documents) tab. You can view results through the three standard views (Table, Tree, and JSON), but they will not be editable.
2. On the IntelliShell toolbar, click on the Enable Query Assist button ().
3. Select (highlight) the second and third commands, as shown in the following figure.
4. Click the Run selection button () on the toolbar.
IntelliShell will run the two selected commands. The bottom window should now contain two result tabs: Raw Shell Output and Find Query.
- The Raw Shell Output tab displays the message returned by running the first selected command (the
use
statement) - The Find Query tab displays the documents returned by running the second selected command (the
find
query).
The following figure shows the Find Query tab, with the results displayed in Tree View and the first document expanded.
IntelliShell names the result tabs based on the type of query. Because the use
statement returns only a message, the return tab for this command is displayed in the Raw Shell Output tab.
For queries that return document data, IntelliShell often names the tab after the method used within this query. For example, the find
method is used in the second command, so the result tab is named Find Query. However, if the aggregate
method had been used, the result tab would have been named Aggregate Query.
The Find Query tab (and other tabs of this kind) include many of the same features as a collection tab. For example, you can add, edit, or delete documents. You can also view the results in Tree View, Table View, or JSON View, as well as set several display properties.
Feel free to experiment with the different features to become better acquainted with ways of displaying results.
5. When you are finished experimenting with the different display features, close IntelliShell.
If prompted to save changes, click No.
6. Close the bios collection tab.
7. In the Connection Tree, right-click the BioData database node and click Drop Database.
8. In the Drop Database dialog box, click Drop Database.
9. Close Studio 3T.