# Docker Reader

All component configurations are classified broadly into 3 section

* [Basic ](https://docs.bdb.ai/bdb-documentation/data-pipeline/components/component-base-configuration)
* Metadata
* [Resource Configuration](https://docs.bdb.ai/bdb-documentation/data-pipeline/components/resource-configuration)

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="success" %}
*Check out the below-given walk through about the PyMongo Reader.*
{% endhint %}

![PyMongo reader component in use](https://972575688-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRYq1HgffNfbnIMWPu1D5%2Fuploads%2FFblhD8E0VUwxAdzpIkkJ%2FAnimation.gif?alt=media\&token=430f6090-48f3-424a-9456-bb315900de53)

## Accessing the Component Properties

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

![Component Properties tabs for the PyMongo Reader ](https://972575688-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRYq1HgffNfbnIMWPu1D5%2Fuploads%2FyT8EKyMSWTuMwJmOjr3n%2Fimage.png?alt=media\&token=e9404791-6c05-43bd-8661-3763916b6f21)

## **Basic Information**&#x20;

It is the default tab to open for the PyMongo Reader 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.

&#x20;     ![](https://972575688-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRYq1HgffNfbnIMWPu1D5%2Fuploads%2FcTKOEOPPGnuMq0Tev62e%2Fimage.png?alt=media\&token=4654779a-c9b5-49c8-9087-bab75c08d491)

* ***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).

![Basic Information tab for the PyMongo Reader component ](https://972575688-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRYq1HgffNfbnIMWPu1D5%2Fuploads%2FexBnFIFLvitDujTFXmsq%2Fimage.png?alt=media\&token=fe2a540a-f491-456c-afc4-6d733b2b4ea8)

{% 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.*

![](https://972575688-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRYq1HgffNfbnIMWPu1D5%2Fuploads%2FCrFzjedl0H83qS2K2ENM%2Fimage.png?alt=media\&token=6a2e3dfa-df0b-4e94-9840-9344db41728c)
{% endhint %}

<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://972575688-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRYq1HgffNfbnIMWPu1D5%2Fuploads%2FCrFzjedl0H83qS2K2ENM%2Fimage.png?alt=media\&token=6a2e3dfa-df0b-4e94-9840-9344db41728c)

</details>

## Meta Information

Open the ***Meta Information tab*** and *fill in all the connection-specific details of PyMongo Reader*. The ***Meta Information*** tab opens with the below given fields:

![Meta Information tab with the basic fields.](https://972575688-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRYq1HgffNfbnIMWPu1D5%2Fuploads%2FdKO1cFG3VwWXbK37G5BM%2Fimage.png?alt=media\&token=60e5ad1e-a228-4f1b-87b9-6d90a10d5c04)

{% hint style="info" %}
*<mark style="color:green;">Please Note:</mark> The Meta Information fields may vary based on the selected **Connection Type** option.*
{% endhint %}

### Configuring the over all Meta Information tab fields

* ***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.
* ***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 Mongo queries in the below-given manner:

```
bi_testing.d1.find({ "$or": [ { "AmountSpent": "10255" } , { "Age": "Old" } ] })// Some code
```

```
db.collection_name.aggregate([
        {
        '$match': {
        'Goal1Adjective': 'High'
        }
        }
        ])
```

### Variations in the Meta Information tab fields

<details>

<summary>Meta Information Tab with Standard as the Connection Type </summary>

The ***Meta Information Ta***&#x62; with ***Standard*** as the ***Connection Type*** <mark style="color:green;">will have</mark> an extra field to provide ***Port** number*.

![](https://972575688-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRYq1HgffNfbnIMWPu1D5%2Fuploads%2FZ43NifD08ZUZYed7fM13%2Fimage.png?alt=media\&token=ba4d17d8-5ac4-4ce1-8bbb-1b839264b84d)

</details>

<details>

<summary>Meta Information Tab with SRV as the Connection Type</summary>

The ***Meta Information Tab*** with ***SRV*** as the ***Connection Type***, <mark style="color:red;">will not</mark> <mark style="color:red;">display</mark> a ***Port*** *field*.

![](https://972575688-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRYq1HgffNfbnIMWPu1D5%2Fuploads%2FbGVlimlpPnQTgIRNUlx4%2Fimage.png?alt=media\&token=35ebb840-f66c-4db5-826c-1bc295e0795b)

</details>

<details>

<summary>Meta Information Tab with Connection String as the Connection Type</summary>

The ***Meta Information Tab*** with ***Connection String*** as the ***Connection Type*** <mark style="color:green;">will have</mark> a ***connection string*** *field*.

![](https://972575688-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRYq1HgffNfbnIMWPu1D5%2Fuploads%2FjPlszo3e2Lx6s0IFZ7oh%2Fimage.png?alt=media\&token=c6be98b1-db40-48af-80ef-43b72f0c753a)

</details>

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

![The Save Component in Storage icon](https://972575688-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRYq1HgffNfbnIMWPu1D5%2Fuploads%2FQ0eVE9kDym3l30tW3y06%2Fimage.png?alt=media\&token=37ed0932-1701-4136-b42d-9b5a560ae7ba)

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

&#x20;     ![](https://972575688-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRYq1HgffNfbnIMWPu1D5%2Fuploads%2F20H49AToFBZZPEK49FyJ%2Fimage.png?alt=media\&token=2a881c5b-e4e7-4ce5-853c-ceaeb51e4d6a)

## Updating and Activating Pipeline

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

&#x20;      ![](https://972575688-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRYq1HgffNfbnIMWPu1D5%2Fuploads%2F6tzKFq0PSRmq4y2g8XCG%2Fimage.png?alt=media\&token=22d7812e-1d8b-43d3-9513-5f9b13ad0227)

* A confirmation message appears to inform the user.

&#x20;     ![](https://972575688-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRYq1HgffNfbnIMWPu1D5%2Fuploads%2FiHFWrmuwnKk89KV7Gves%2Fimage.png?alt=media\&token=4b09b235-2956-48d1-9a78-3f0e96dc05d4)

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

&#x20;     ![](https://972575688-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRYq1HgffNfbnIMWPu1D5%2Fuploads%2F4MTazsUWXNN7C98Xuam8%2Fimage.png?alt=media\&token=d46c5139-7bd6-4c54-aa63-ad6c0577359e)

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

&#x20;      ![](https://972575688-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRYq1HgffNfbnIMWPu1D5%2Fuploads%2Fq55T65z0gaMMPv3ETpTu%2Fimage.png?alt=media\&token=72ad1054-3af9-4482-a1e2-fccdcb90938a)

* A confirmation message appears to inform that the pipeline has been activated.&#x20;

&#x20;     ![](https://972575688-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRYq1HgffNfbnIMWPu1D5%2Fuploads%2FSQjPmK7jtjivMsmqcybq%2Fimage.png?alt=media\&token=f75000f9-e8aa-4880-acb4-f950a354dc3c)

## Accessing the Log Panel

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

&#x20;     ![](https://972575688-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRYq1HgffNfbnIMWPu1D5%2Fuploads%2Fcu37bMBKURGCsUh6Nkwu%2Fimage.png?alt=media\&token=d8d576ca-8872-4401-8005-9ea36f4a6f80)

{% hint style="info" %}
*<mark style="color:green;">Please Note:</mark>*&#x20;

* *The Pod logs for the components appears in the **Advanced Logs** tab.*
* *The overall component logs will be displayed in the **Logs** tab*.&#x20;
  {% endhint %}

### Tabs for a Configured Component

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

![More tabs for a configured PyMongo Reader component](https://972575688-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRYq1HgffNfbnIMWPu1D5%2Fuploads%2FC2GnAnp75ezXzRIEaMqm%2Fimage.png?alt=media\&token=6133e1b3-e6a2-4f56-846f-19c6d89f1949)

<details>

<summary>Configuration Tab</summary>

The Configuration tab displays the default configuration for CPU memory Limit and Request specification which can be modified by the use&#x72;**.**

![](https://972575688-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRYq1HgffNfbnIMWPu1D5%2Fuploads%2FmEZa68wxpdlsPDwVWP7v%2Fimage.png?alt=media\&token=13bf17ca-8774-4496-ba9a-5c8da1f718d1)

</details>

<details>

<summary>Logs Tab</summary>

The Log tab displays the ***component logs** with the **Refresh Logs** option*.

![](https://972575688-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRYq1HgffNfbnIMWPu1D5%2Fuploads%2FFyJvxnMZQIxCH88CFDH6%2Fimage.png?alt=media\&token=6abde34d-d836-409f-a676-523e027064de)

</details>

<details>

<summary>Pod Logs Tab</summary>

*It displays the **Pod Logs** with the **Refresh Logs** optio&#x6E;**.***

![](https://972575688-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRYq1HgffNfbnIMWPu1D5%2Fuploads%2FUb3MB1zCIHMzD9tooeR0%2Fimage.png?alt=media\&token=f82185e7-dcdb-4ded-a908-9a00bba88f1b)

</details>
