> For the complete documentation index, see [llms.txt](https://docs.bdb.ai/data-pipeline-5/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bdb.ai/data-pipeline-5/getting-started/homepage/create/creating-a-new-job/spark-job/readers/mongodb-reader.md).

# MongoDB Reader

This task is used to read data from MongoDB collection.

## Configuring the Meta Information tab fields <a href="#configuring-the-over-all-meta-information-tab-fields" id="configuring-the-over-all-meta-information-tab-fields"></a>

Drag the MongoDB reader task to the Workspace and click on it to open the related configuration tabs for the same. The ***Meta Information*** tab opens by default.

* **Connection Type**: Select the connection type from the drop-down:
  * **Standard**
  * **SRV**&#x20;
  * **Connection String**
* ***Port*** (\*): Provide the Port number (*It appears only with the **Standard** connection type*).
* ***Host IP Address*** (\*): The IP address of the host.
* ***Username*** (\*): Provide a username.
* ***Password*** (\*): Provide a valid password to access the MongoDB.
* ***Database Name*** (\*): Provide the name of the database where you wish to write data.
* ***Additional Parameters***: Provide details of the additional parameters.
* **Cluster Shared:** Enable this option to horizontally partition data across multiple servers.
* **Schema File Name:** Upload Spark Schema file in JSON format.
* ***Query:*** Please provide Mongo Aggregation query in this field.

<figure><img src="/files/2DYKJakWUaUBa76UbRqe" alt=""><figcaption><p><em><strong>MongoDB Reader Task</strong></em></p></figcaption></figure>

{% hint style="info" %}
*<mark style="color:green;">Please Note:</mark> Please click the **Save Task In Storage** icon to save the configuration for the dragged reader task.*
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.bdb.ai/data-pipeline-5/getting-started/homepage/create/creating-a-new-job/spark-job/readers/mongodb-reader.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
