User-friendly queries
The data browser has been extended with the functionality of generating and executing user-friendly queries.
This feature allows to build queries without needing to handle the underlying syntax of the database’s query language.
Main benefits and advantages
- Collections are now selectable and searchable using a drop-down menu
- “User-friendly queries” now allow to filter within a selected collection
- The underlying query generated by the tool can be extracted as a native MongoDB aggregation query for later use in a query template
Example of execution of user-friendly queries
Enter the desired path
By typing into the “Path” input field, you will be provided with suggestions. Subsequently, select the one you want to filter for or enter a custom path.
Enter the (relational) operator
The circled button always displays the currently selected operator.
By default, “equals” is the default operator.
For changing the operator, simply click on the circled button and change it to another one.
Enter the “Data Type” and “Value”
Using the “Data Type” drop down menu, select the data type of your value.
An auto detection assists you to detect a suitable data type.
To avoid unexpected results, proof the data type matches your data model definition. Finally, enter your value – if required – and add the query param by clicking the “Add” button.
Combining several filters
Subsequently, after adding a second filter, the “Compound Logic Editor” will appear. It displays how each filter relates to another.
You can edit the logic as follows:
- Click on “AND” to swap to an “OR” – and vice-versa
- In order to extend the logic, type in an “AND”, “OR” and a numeric filter indicator
- For grouping and prioritizing filters, type in parenthesizes
Display the executed query
Once clicked on “Search”, the “Show Query” will become available.
Clicking on it, will display the executed query as MongoDB aggregation query.
For more details and information, please refer to the Official Guide of Bosch IoT Insights.