MongoDB

Use the MongoDB Connector to send data from Decodable to MongoDB. If you are looking for information about how to create a connection to get data from MongoDB into Decodable, see MongoDB CDC in the Connect to a data source chapter.

Overview

Connector name

mongo

Type

sink

Delivery guarantee

exactly once

Supported stream types

append, change

Create a connection to MongoDB

Follow these steps to get data into MongoDB. These steps assume that you are using Decodable Web interface. However, if you want to use the Decodable CLI to create the connection, you can refer to the Property Name column for information about what the underlying property names are.

Steps

  1. From the Connections page, select the MongoDB Connector and complete the following fields.

    UI Field Property Name in the Decodable CLI Description

    Connection String

    connection-string

    The connection string for your MongoDB cluster without your username and password. Decodable supports both the Standard Connection String and DNS Seed List Connection String formats.

    For example: mongodb(+srv)://my-cluster.mongodb.net/?retryWrites=true&w=majority

    Database

    database

    The name of the database containing the collection that you want to send data to.

    Collection

    collection

    The name of the collection to send data to.

    Username

    username

    Your MongoDB username.

    Password

    password

    The secret containing your MongoDB password.

  2. Select the stream that you’d like to connect to this connector. This will be the stream that sends records from Decodable into MongoDB. Then, select Next.

  3. Define the connection’s schema. Select New Schema to manually enter the fields and field types present or Import Schema if you want to paste the schema in the form of an Avro or JSON array.

    1. The stream’s schema must match the schema of the data that you plan on sending through this connection.

    2. For more information about creating a stream or defining the stream schema, see Create and manage streams.

  4. Select Next when you are finished providing defining the connection’s schema.

  5. Give the newly created connection a Name and Description and select Save.

Start the connection and observe data flow into your MongoDB instance.