Bosch IoT Insights

MongoDB operations

Using the Data Analyzer, you can create MongoDB queries that will be executed against the project-specific MongoDB collections of your project. You can choose between different MongoDB collections: the collection containing processed data and the collection which contains the Thing History.

Note that the provided links to the MongoDB documentation below point to the latest MongoDB version. Bosch IoT Insights always uses the version prior to the latest version.

General functions

The following generic functions are provided:

Autoformatting

Click the Autoformat button to automatically indent the formatting of the query.

Loading the Default Query

Click the Load Default Query button to load the default query displayed below.

[
{
"$match": {}
},
{
"$limit": 10
}
]

Tag

In the Tag field, enter a keyword to easily find the the query in the Query History.

Aggregation

Create a query with mathematical calculations.

The aggregation is performed with the MongoDB aggregation pipeline which transforms and groups the data.

Hint

Enter an index into the Hint object if you want to give MongoDB a hint which index should be used for this query.

The index has an own name which may differ from the field name.

Refer to the MongoDB Aggregation Reference chapter in the MongoDB documentation.

Find

Create a query to search for specific documents.

Projection

Enter a specific element into the Projection object to limit the result to given elements of a document.

Sort

Enter a sort query into the Sort object to sort the result ascending or descending.

Hint

Enter an index into the Hint object if you want to give MongoDB a hint which index should be used for this query.

The index has an own name which may differ from the field name.

Refer to the MongoDB Find Reference chapter in the MongoDB documentation.

Count

Create a query to count documents.

Hint

Enter an index into the Hint object if you want to give MongoDB a hint which index should be used for this query.

The index has an own name which may differ from the field name.

Refer to the MongoDB Count Reference chapter in the MongoDB documentation.

Distinct

Create a query to find distinct values for a specific field.

Field

In the Field field, enter the document field name for which the distinct values shall be searched.

Refer to MongoDB Distinct Reference chapter in the MongoDB documentation.