# Query tab

![MongoDB Input Query tab](/files/wLadU6aLhvYX9FMuMUm1)

Use the **Query** tab to refine read requests. This tab operates in two different query modes:

* **Query expression** mode (default)
* **Aggregation pipeline specification** mode.

The **Query is aggregation pipeline** option toggles between these two modes. The **Query expression** uses MongoDB’s JSON-like query language with [query operators](https://docs.mongodb.com/manual/reference/operator/query/) to perform query operations. The **Aggregation pipeline specification** field uses MongoDB’s [aggregation framework](http://docs.mongodb.org/manual/applications/aggregation/) to transform and combine documents in a collection. An aggregation pipeline connects several [pipeline expressions](https://docs.mongodb.com/manual/core/aggregation-pipeline/#pipeline-expressions) together, with the output of the previous expression becoming the input for the next.

Enter the following information in the **Query** fields:

| Fields/Option                                 | Definition                                                                                                                                                                                                                                                                                                                                        |
| --------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Query expression (JSON)**                   | Enter a query expression in this field to limit the output.                                                                                                                                                                                                                                                                                       |
| **Aggregation pipeline specification (JSON)** | Select the **Query is aggregation pipeline** option to display the **Aggregation pipeline specification (JSON)** field. Then enter a pipeline expression to perform aggregations or selections. The method name, including the collection name of the database you selected in the **Input Options** tab, appears after the label for this field. |
| **Query is aggregation pipeline**             | Select this option to use the aggregation pipeline framework.                                                                                                                                                                                                                                                                                     |
| **Allow disk use**                            | Select this option to turn on the **allowDiskUse** property so that you can process aggregation pipeline data when it exceeds the standard 100MB RAM allocation.                                                                                                                                                                                  |
| **Execute for each row**                      | Select this option to perform the query on each row of data.                                                                                                                                                                                                                                                                                      |
| **Fields expression (JSON)**                  | Enter an argument to control the projection (fields to return) from a query. If empty, all fields are returned. This field is only available for query expressions.                                                                                                                                                                               |


---

# 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://docs.pentaho.com/pdia-data-integration/10.2-data-integration/pdi-transformation-steps-reference-overview/mongodb-input/options-mongodb-input/query-tab.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.
