> For the complete documentation index, see [llms.txt](https://boomi.markusschmidt.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://boomi.markusschmidt.pro/boomi-console/commands/arguments/common-arguments/query-files.md).

# 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>
