Skip to main content

Overview

MindBridge Query Language (QL) is the standard unified query language used to interact with all the underlying data tables and collections within MindBridge. This query language has been extended to the MindBridge API, which uses this syntax for all /query endpoints within the API, as well as several other endpoints.

Syntax

The query is expressed as a JSON object. The example below looks for values equal to 10000 in the credit column.
Above, $eq is the equality operator. Other operators are listed below. As a shortcut for equality, you can specify the value directly.
In order to conform to the syntax of a valid JSON object, all operators and fields must be enclosed in quotes. For more details on the JSON language, refer to json.org. Logical AND and OR conditions are available. If you want to specify two columns, the conditions can be combined with $and.

Simplified Syntax

The example $and query above can be simplified using the syntax seen below.
You can combine $or and $and to build up a more complex structure, such as the one seen below, which combines all the techniques seen so far.
You can use two operators on the same column at the same time:

Unique Names

Every field in a JSON object or sub-object must be unique. The following is not valid because source appears twice at the top level.
Instead, wrap it in $and:
Or use another operator like $nin:
You can use two operators on the same column at the same time:

Column Operators

Column operators apply a filter to a specific column.

Root Operators

Logical Operators

Logical operators allow MindBridge to combine Column Operation queries to allow for more sophisticated calls.

Keyword Operators

Keyword operators are applied simultaneously to all columns that support keyword searches. This is controlled by the keywordSearch attribute associated with the column’s metadata.

Population Operators

Population operators test whether the specified entry is or is not included within the specified population, identified by its ID. The population in question must be accessible from the analysis, meaning the population must be part of the analysis, engagement, or library that this data table resides in. The correct usage of $population and $not_population is as follows, with 643eff00ec992f7ec42ed9f7 being a valid population ID:

Data Formats

Because the MindBridge QL is based on JSON, strings, numbers, and booleans are natively included in the language definition, but other values require some conversion. The following table describes the values MindBridge QL accepts in relation to our internal data structure. The contents of the “Column Type” column (below) represent the data types supported internally and how they are mapped to the JSON object structure.