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 namemongo
Typesink
Delivery guaranteeexactly once
Supported stream typesappend, 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 FieldProperty Name in the Decodable CLIDescription
Connection Stringconnection-stringThe 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
DatabasedatabaseThe name of the database containing the collection that you want to send data to.
CollectioncollectionThe name of the collection to send data to.
UsernameusernameYour MongoDB username.
PasswordpasswordThe secret containing your MongoDB password.
  1. 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.
  2. 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 a Stream.
  3. Select Next when you are finished providing defining the connection’s schema.
  4. Give the newly created connection a Name and Description and select Save.

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