# Query Filter

The `/QueryFilter` is just antoher option to [specify component IDs](/boomi-console/commands/arguments/common-arguments/command-sources.md) for your commands. You can specify [Runtime API Query Filters](https://help.boomi.com/bundle/developer_apis/page/r-atm-Query_filters.html) as the source for any command.

See also [Component Metadata Filter properties](https://help.boomi.com/bundle/developer_apis/page/int-Component_metadata_object.html).

```
bc COMP GET -QueryFilter Query\qDBProfiles.json
```

```json
{
  "QueryFilter": {
    "expression": {
      "operator": "and",
      "nestedExpression": [
        {
          "operator": "or",
          "nestedExpression": [
            { "property": "type",   "operator": "EQUALS",   "argument": [ "profile.db"   ] }
          ]
        },
        { "operator": "GREATER_THAN", "property": "modifiedDate",   "argument": ["{StartDateUtc}"]},
        { "operator": "EQUALS",       "property": "currentVersion", "argument": ["true" ]},
        { "operator": "EQUALS",       "property": "deleted",        "argument": ["false" ]}
      ]
    }}
}
```

*Boomi Console* will run the query against the [Component Metadata API](https://help.boomi.com/bundle/developer_apis/page/int-Component_Metadata_API_example_requests.html) using `ComponentMetadata/query`. The returned components will be used as the input for your command. If you run `COMP GET -QueryFilter <yourFilter>`, for example, the query is executed and the returned list of components will then be retrieved from API.

{% hint style="info" %}
Please notice, the `QueryFilter` functionality automatically handles the `QueryToken` so that the number of returned components is *not* limited to one page.
{% endhint %}

### Query Filter File

Query Filters are specified as a JSON file. I recommend using the `Query` folder to store the queries there. I decided to use JSON over XML because it is much more readable. There is no option to provide XML queries.

## Example

`bc comp get /q query\qDBProfiles.json /outdir=query\DBProfiles`

Specify `/OutDir` to redirect the output to the specified directory instead of writing it to the default `Workspace\Out` directory.

Once you have got the Metadata XML for profiles specified in the QueryFilter, you may want to see their natice specification:

`bc create profile /outdir=query\DBProfiles`

<figure><img src="/files/PF1sHrTeLlMqvYkeelTg" alt=""><figcaption><p>query\DBProfiles - MetadatXML and the native DB profile: SQL Scripts</p></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://boomi.markusschmidt.pro/boomi-console/commands/arguments/common-arguments/query-files.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
