Query Parameters Format

Query parameters are replaced at runtime during query execution based on user level filters set or if contentFilters are passed into the dashboard (typically via the embed API).

$c9_macroName$(defaultValue)$[label]$

Creating a runtime query parameter with a label:

Adding the Runtime query into a dashboard:Add the above widget into a dashboard. The runtime query can now be run for both widget and dashboard filters and the value will be injected into the query created above.

Another Query Example:

db['pagehits'].find(
{"Region":{"$eq":"$c9_region$(West)$"}}
)

$c9_region$ is replaced with contentFilter parameter (and defaults to West in the above example if one is not passed in).

This can be passed in either using the contentFilters URL parameter, via the JavaScript API, or can be set at user level. User level filters are always applied automatically for that user and cannot be modified by the user.

For example, we define a user contentFilters or URL contentFilters as: