> For the complete documentation index, see [llms.txt](https://docs.bdb.ai/7.6/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/7.6/data-pipeline/components/writers/mongo-writers/mongo-writer-docker.md).

# Mongo Writer(Docker)

All component configurations are classified broadly into the following sections:

* [Basic ](/7.6/data-pipeline/components/component-base-configuration.md)
* Metadata
* [Resource Configuration](/7.6/data-pipeline/components/resource-configuration.md)
* [Connection Validation](/7.6/data-pipeline/components/connection-validation.md)

{% hint style="success" %}
*Please follow the demonstration to configure the component.*
{% endhint %}

![Configuring the PyMongo Writer (Docker)](https://4128708524-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGDmsjfjJBNqow7Fo97cO%2Fuploads%2Fbu6MoxAuonwII1tnVFHT%2FPymongo_writer_gif.gif?alt=media\&token=5dd048ac-a5d6-4750-a1ff-c81bfb84af80)

## Steps to Configure the Mongo Writer Docker&#x20;

The PyMongo Writer writes the data to the mongo database.

* Drag & drop the PyMongo Writer component to the Workflow Editor.&#x20;

![](https://4128708524-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGDmsjfjJBNqow7Fo97cO%2Fuploads%2Fk1YSxbiERabXsqiv6DXr%2Fimage.png?alt=media\&token=6ceb770a-ca09-4d59-b28c-476156a56465)

* Click the dragged PyMongo Writer component to open the component properties tabs below.

### Basic Information

It is the default tab to open for the PyMongo Writer 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 preselected.
* **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**: Provide the maximum number of records to be processed in one execution cycle.

![](https://4128708524-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGDmsjfjJBNqow7Fo97cO%2Fuploads%2FX8IBMCcKIOmXSXFv4IOn%2Fimage.png?alt=media\&token=47f68291-71c6-44cb-8c11-580b2d98d069)

### Meta Information Tab

Open the ‘Meta Information tab and configure all the connection-specific details for the PyMongo Writer.

1. ***Connection Type***: Select either of the options out of the ***Standard,*** ***SRV,*** and ***Connection String*** connection types.
2. ***Port number*** (\*): Provide the Port number (It appears only with the ‘Standard’ connection type).
3. ***Host IP Addres***&#x73; (\*): IP address of the host.
4. ***Username*** (\*): Provide username.
5. ***Password*** (\*): Provide a valid password to access the Mongo DB.
6. ***Database Name*** (\*): Provide the name of the database where you wish to write data.
7. ***Collection Name*** (\*): Provide the name of the collection.
8. ***Safe Mode***: Select an option from the drop-down menu (the supported options are Upsert and Append).
9. ***Composite Keys*** (\*): This field appears only when the selected save mode is ‘Upsert’. The user can enter multiple composite keys separated by commas on the basis of which upsert happens.
10. ***Additional Parameters***: Provide details of the additional parameters.
11. ***Connection String*** (\*): Provide a connection string.

![](https://4128708524-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGDmsjfjJBNqow7Fo97cO%2Fuploads%2F6YfifOdBSw52IG8iT5lT%2Fimage.png?alt=media\&token=929f5ad2-c38f-4c9f-acf4-4bcc54274ad3)

**The Meta Information fields vary based on the selected ‘Connection Type’ option.**

* Meta Information Tab with **Standard** as the Connection Type.&#x20;

![](https://4128708524-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGDmsjfjJBNqow7Fo97cO%2Fuploads%2FVAKlmwZJdywjMLeSNyK1%2Fimage.png?alt=media\&token=4b219918-2b1d-4ece-9f4c-87ab189243e0)

* Meta Information Tab with **SRV** as the Connection Type.&#x20;

![](https://4128708524-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGDmsjfjJBNqow7Fo97cO%2Fuploads%2FvPWEjYUy2QOnYelETZu6%2Fimage.png?alt=media\&token=5b3fb714-d131-4156-8e7f-f376abb9ac75)

* Meta Information Tab with **Connection String** as the Connection Type.&#x20;

![](https://4128708524-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGDmsjfjJBNqow7Fo97cO%2Fuploads%2Fm8l5VRQCcK4XObvePlLZ%2Fimage.png?alt=media\&token=6d048176-da13-4510-a52a-17efd0040acb)

&#x20;

### Selected Columns

The users can select some specific columns to change the column name or data type while writing it to the collection.

* Users have to type the name of the column in the name field that has to be modified.
* If you went to change the name of the column, then put the name of your choice in the alias name section otherwise keep it the same as of column name.
* Then select the Column Type from the drop-down menu into which you want to change the datatype of that particular column.
* Once this is done, while writing the selected column data type and column name will be converted to your given choice.

or

Use the ***Download Data*** and ***Upload File*** options to select the desired columns.

1. ***Upload File:*** The user can upload the existing system files (CSV, JSON) using the ***Upload File*** icon (file size must be less than 2 MB).
2. ***Download Data (Schema)***: Users can download the schema structure in JSON format by using the ***Download Data*** icon.

![](https://4128708524-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGDmsjfjJBNqow7Fo97cO%2Fuploads%2FYwJ3HtOtJCirxykUSZ3x%2Fimage.png?alt=media\&token=7a6fea69-de83-4f3e-80de-850987b72448)

### Saving the Component Configuration

* Click the ‘Save Component in Storage’ icon for the PyMongo Writer component.
* A message appears to notify the successful update of the component.

&#x20;      ![](https://4128708524-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGDmsjfjJBNqow7Fo97cO%2Fuploads%2F9VYFFCOQgts0Q2rQJ3lE%2Fimage.png?alt=media\&token=041cffc9-5bc0-4b30-a439-ef2b6f7dea9c)

* Click on the ***Activate Pipeline*** icon.
* PyMongo Writer will write the data for the collection.
