> For the complete documentation index, see [llms.txt](https://docs.bdb.ai/data-pipeline/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/~/changes/BozVtU3tL5BwgOHeoMZt/components/readers/mongo-db-reader/mongodb-reader-lite.md).

# Mongodb Reader Lite

This page covers the configuration steps for the Mongo DB Reader.All component configurations are classified broadly into the following sections:

* ​[Basic ](https://docs.bdb.ai/7.6/data-pipeline/components/component-base-configuration)​
* Metadata
* ​[Resource Configuration](https://docs.bdb.ai/7.6/data-pipeline/components/resource-configuration)​
* ​[Connection Validation](https://docs.bdb.ai/7.6/data-pipeline/components/connection-validation)​

MongoDB Reader reads data from the specified database’s Collection. It also has an option to filter the data using Mongo Query Language(MQL), Which will run the MQL directly on the MongoDB Server, and push the data to the out event.

{% hint style="info" %}
*Check out the below-given walk through about the PyMongo Reader.*
{% endhint %}

{% embed url="<https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fuq3RSHHup7fjHYaspk7y%2Fuploads%2Fgv0G9OKtvII8dQuxKOBJ%2Fmongo_reader_lite_AdobeExpress.mp4?alt=media&token=abcdcbc1-b713-42f3-b7f1-cfbdb32b4672>" %}
Mongo Reader Lite in use
{% endembed %}

## Accessing the Component Properties <a href="#accessing-the-component-properties" id="accessing-the-component-properties"></a>

* Drag & drop the ***Mongo Reader*** component to the ***Workflow Editor***.
* Click on the dragged reader component.
* The component properties tabs open below.

## **Basic Information**  <a href="#basic-information" id="basic-information"></a>

It is the default tab to open for the Mongodb Reader Lite while configuring the component.

* Select an ***Invocation Type*** from the drop-down menu to confirm the running mode of the reader component. Select ***Real-Time*** or ***Batch*** from the drop-down menu.​
* ***Deployment Type***: It displays the deployment type for the component (This field comes pre-selected).
* ***Container Image Version***: It displays the image version for the docker container (This field comes pre-selected).
* ***Failover Event:*** Select a failover Event from the drop-down menu.
* ***Batch Size (min 10):*** Provide the maximum number of records to be processed in one execution cycle (Min limit for this field is 10).

{% hint style="info" %} <mark style="color:green;">Please Note:</mark> *The* ***Grace Period Field** appears when the **Batch** is selected as the **Invocation Type** option in the **Basic Information** tab. You can now give a grace period for components to go down gracefully after that time by configuring this field.*&#x200B;
{% endhint %}

<figure><img src="https://363587200-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fuq3RSHHup7fjHYaspk7y%2Fuploads%2F2XsBxKvOoMbf9l8reWHp%2Fimage.png?alt=media&amp;token=752dbf2a-afca-40c5-9a1c-b408b9075292" alt=""><figcaption></figcaption></figure>

<details>

<summary>Grace Period Field</summary>

The Grace Period field appears when the Batch option is selected as the Invocation Type. You can now give a grace period for components to go down gracefully after that time by configuring the given field in the Basic Information of the concerned component.

![](https://363587200-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fuq3RSHHup7fjHYaspk7y%2Fuploads%2FcFbIurQVnAR52FfPxsR2%2Fimage.png?alt=media\&token=cc7660be-337a-4b9c-9251-5e208bdb55a5)

</details>

## Meta Information <a href="#meta-information" id="meta-information"></a>

Open the ***Meta Information tab*** and *fill in all the connection-specific details of* Mongodb Reader Lite. The ***Meta Information*** tab opens with the below given fields:&#x20;

<figure><img src="https://363587200-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fuq3RSHHup7fjHYaspk7y%2Fuploads%2FuDBJfKu0iwP9IbMbSEgQ%2Fimage.png?alt=media&amp;token=672a8393-b830-4196-8ba0-8ac6532623dd" alt=""><figcaption><p>Meta Information tab with the basic fields.</p></figcaption></figure>

{% hint style="info" %}
*Please Note: The Meta Information fields may vary based on the selected **Connection Type** option.*
{% endhint %}

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

* ***Connection Type***: Select either of the options out of ***Standard**, **SRV**, and **Connection String*** connection types.
* ***Port number*** (\*): 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 Mongo DB.
* ***Database Name*** (\*): Provide the name of the database where you wish to write data.
* ***Collection Name*** (\*): Provide the name of the collection.
* ***Fetch size:*** Specifies the number of documents to return in each batch of the response from the MongoDB collection. For ex: If 1000 is given in the fetch size field. Then it will read the 1000 data at one execution and it will process it further.&#x20;
* ***Additional Parameters***: Provide details of the additional parameters.
* ***Connection String*** (\*): Provide a connection string (*It appears only with the **Connection String** connection type)*.
* ***Query***: Provide a relevant query service. We can write the Mongo queries in the following manner:

```mongodb
bi_testing.d1.find({ "$or": [ { "AmountSpent": "10255" } , { "Age": "Old" } ] })// Some codedb.collection_name.aggregate([{'$match': {'Goal1Adjective': 'High'}}])
```

### Variations in the Meta Information tab fields <a href="#variations-in-the-meta-information-tab-fields" id="variations-in-the-meta-information-tab-fields"></a>

* [x] Meta Information Tab with **Standard as the Connection Type**

<figure><img src="https://363587200-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fuq3RSHHup7fjHYaspk7y%2Fuploads%2FD3t9NMFyqJV0X6a40Vxs%2Fimage.png?alt=media&amp;token=cdf363cc-26b5-4fe5-88d9-07e85743eaf9" alt=""><figcaption></figcaption></figure>

* [ ] Meta Information Tab with **SRV as the Connection Type**

<figure><img src="https://363587200-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fuq3RSHHup7fjHYaspk7y%2Fuploads%2FMrlnmqxy2ddNHVfGiznG%2FMicrosoftTeams-image%20(69).png?alt=media&amp;token=f0b6d228-d330-4a31-9124-fb2032236280" alt=""><figcaption></figcaption></figure>

* [x] Meta Information Tab with **Connection String as the Connection Type**

<figure><img src="https://363587200-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fuq3RSHHup7fjHYaspk7y%2Fuploads%2FwysMKkOPl99bcfmawqr8%2FMicrosoftTeams-image%20(70).png?alt=media&amp;token=0d7b01c6-f46c-47d8-aeda-298d92af4e90" alt=""><figcaption></figcaption></figure>

## Saving the Reader Component

After configuring the required configuration fields, click the ***Save Component in Storage*** icon provided in the reader configuration panel to save the component.

<figure><img src="https://363587200-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fuq3RSHHup7fjHYaspk7y%2Fuploads%2FlP7dQgayxQzLnijQruX0%2FMicrosoftTeams-image%20(71).png?alt=media&amp;token=f43c4f2f-9c11-4385-9bd6-b0c3c1ee2ff2" alt=""><figcaption></figcaption></figure>

* A confirmation message appears to notify the component properties are saved.

## Updating and Activating Pipeline <a href="#updating-and-activating-pipeline" id="updating-and-activating-pipeline"></a>

* Click on the ***Update Pipeline*** icon to update the pipeline.

<figure><img src="https://363587200-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fuq3RSHHup7fjHYaspk7y%2Fuploads%2Fr8iKwpYjCjY6lh2JYtMp%2FMicrosoftTeams-image%20(74).png?alt=media&amp;token=6df5a4f0-7a38-4fb8-af31-7328100d4891" alt=""><figcaption></figcaption></figure>

* A confirmation message appears to inform the user.

<figure><img src="https://363587200-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fuq3RSHHup7fjHYaspk7y%2Fuploads%2F8MZzRC6AwUUktXvZrF8C%2FMicrosoftTeams-image%20(73).png?alt=media&amp;token=f43f6a9a-6458-4fa1-b05f-8c25fb267d16" alt=""><figcaption></figcaption></figure>

* Click on the ***Activate Pipeline*** icon.​

<figure><img src="https://363587200-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fuq3RSHHup7fjHYaspk7y%2Fuploads%2FHlp3kjcbxKXMAtBFaSGn%2FMicrosoftTeams-image%20(75).png?alt=media&amp;token=a78591a1-c9c0-48a6-87a5-1b13491e19d8" alt=""><figcaption></figcaption></figure>

* The Confirm dialog box appears to ask the user permission.
* Click the ***YES*** option.

<figure><img src="https://363587200-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fuq3RSHHup7fjHYaspk7y%2Fuploads%2FscL0Hvy8J1Ny2A8XocDv%2FMicrosoftTeams-image%20(76).png?alt=media&amp;token=a9e1941a-32bb-4899-ae74-72f6471ee61a" alt=""><figcaption></figcaption></figure>

* A confirmation message appears to inform that the pipeline has been activated.

<figure><img src="https://363587200-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fuq3RSHHup7fjHYaspk7y%2Fuploads%2FmTdaNl0GfcoucYlp6WKH%2FMicrosoftTeams-image%20(77).png?alt=media&amp;token=8941e2a1-923f-42fe-8f9b-d5367553b714" alt=""><figcaption></figcaption></figure>

## Accessing the Log Panel <a href="#accessing-the-log-panel" id="accessing-the-log-panel"></a>

* Click on the ***Toggle Log Panel*** icon.
* The ***Log Panel*** opens displaying the ***Logs*** and ***Advance Logs*** tabs.

![](https://859511478-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGDmsjfjJBNqow7Fo97cO%2Fuploads%2FGWSWcQ7xN6i3jxJVi2qm%2Fimage.png?alt=media\&token=d8d576ca-8872-4401-8005-9ea36f4a6f80)​*Please Note:*

* *The Pod logs for the components appears in the **Advanced Logs** tab.*
* *The overall component logs will be displayed in the **Logs** tab*.

## Tabs for a Configured Component <a href="#tabs-for-a-configured-component" id="tabs-for-a-configured-component"></a>

* A configured component will display some more tabs such as the ***Configuration***, ***Logs***, and ***Pod Logs*** tabs (as displayed below for the Mongodb Reader Lite component).

<figure><img src="https://363587200-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fuq3RSHHup7fjHYaspk7y%2Fuploads%2FoUIVCd0akPeF5nCWpJN7%2FMicrosoftTeams-image%20(80).png?alt=media&amp;token=fe8ca2ec-693d-4edf-bc31-cc031da40221" alt=""><figcaption><p>Tabs for a configured PyMongo Reader</p></figcaption></figure>

### Configuration Tab

<figure><img src="https://363587200-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fuq3RSHHup7fjHYaspk7y%2Fuploads%2FbSgdnX2cqKhdw2s9St9S%2FMicrosoftTeams-image%20(78).png?alt=media&amp;token=a93502b9-3764-44b9-888e-9dd77dc1ba1f" alt=""><figcaption></figcaption></figure>

### Logs Tab

<figure><img src="https://363587200-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fuq3RSHHup7fjHYaspk7y%2Fuploads%2FEIYt2iWtXXHeVoxgKSfJ%2FMicrosoftTeams-image%20(79).png?alt=media&amp;token=e309f55f-7a8e-4353-9d20-9843d33dfbdb" alt=""><figcaption></figcaption></figure>

### Pod Logs Tab

<figure><img src="https://363587200-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fuq3RSHHup7fjHYaspk7y%2Fuploads%2FcE4wtRaZBTrtRU7JnyBw%2FMicrosoftTeams-image%20(81).png?alt=media&amp;token=ef9e6894-614f-4bc4-a0e3-27dc7f798694" alt=""><figcaption></figcaption></figure>

## Summary Tab

This tab will show all the description about the component.

<figure><img src="https://363587200-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fuq3RSHHup7fjHYaspk7y%2Fuploads%2FYQlfWK92Qe3VLMUlJB4j%2FMicrosoftTeams-image%20(82).png?alt=media&amp;token=3e1f6504-4369-443d-b8c9-233161a1c097" alt=""><figcaption><p>Summary tab for Mongodb Reader Lite</p></figcaption></figure>
