# Replicate MongoDB® Collections to SingleStore

Change Data Capture (CDC) pipelines enable you to ingest historical data and sync the continuous changes to data as they happen on the source MongoDB® database. SingleStore allows you to replicate your existing MongoDB® collections to your SingleStore Helios database using Change Data Capture (CDC). The CDC pipeline ingests data in the BSON format. You can perform the replication using any of the following methods:

* [Replicate MongoDB® Collections using MongoDB® Wrapper Commands](https://docs.singlestore.com/cloud/reference/singlestore-kai/replicate-mongodb-collections-to-singlestore/replicate-mongodb-collections-using-mongodb-wrapper-commands.md) through the SingleStore Kai endpoint
* [Replicate MongoDB® Collections using SQL](https://docs.singlestore.com/cloud/reference/singlestore-kai/replicate-mongodb-collections-to-singlestore/replicate-mongodb-collections-using-sql.md)

To replicate data from MongoDB® using CDC via AWS PrivateLink, refer to [Replicate MongoDB® Collections via AWS PrivateLink](https://docs.singlestore.com/cloud/reference/singlestore-kai/replicate-mongodb-collections-to-singlestore/replicate-mongodb-collections-via-aws-privatelink.md).

## Prerequisites

## Source Database Requirements

The replication feature uses MongoDB® [change streams](https://www.mongodb.com/docs/manual/changeStreams/), and it works only with replica sets. A MongoDB® user must have the following roles (privileges) to replicate the collections in SingleStore:

* Read the `admin` database for the operation log (oplog)
* Read the `config` database in the configuration server
* `listDatabases` privilege
* `clusterMonitor` role
* Cluster-wide `find` and `changeStream` privileges
* Write permission to the `singlestore` database. The `singlestore` database is automatically created during the replication process.

You can provide the privileges or assign roles to the MongoDB® user using the MongoDB® Atlas UI or MongoDB® commands. For example:

* Using the UI for MongoDB® Atlas:

  1. On the MongoDB® Cloud dashboard, select **Projects > \<your\_project>**.

  2. In the left navigation pane, under **Security**, select **Database Access**.

  3. On the **Database Users page**, select **Edit** for the MongoDB® user used to connect to the MongoDB® instance.

  4. On the **Edit User** dialog, under **Database User Privileges**, select **Specific Privileges > Add Specific Privilege**.

  5. Add the following privileges:

     * `readAnyDatabase`
     * `read` for the `config` database
     * `readWrite` for the `singlestore` database

     ![Provide the readWrite privilege for the singlestore database to the user.](https://images.contentstack.io/v3/assets/bltac01ee6daa3a1e14/blted17cafda8869051/6a2fe82cfcbf1f1de7c50160/mongo-singlestore-db-privilege-ZosRLk.png)

  6. Select **Update User**.
* Using MongoDB® commands for self-managed deployments: The following commands create a role and then assign the role to a user.
  ```MongoDB
  db.adminCommand({ createRole: 'cdcRole', 
    privileges: [
      {'resource': {'cluster': true}, 'actions': ['find', 'changeStream']}
    ], 
    roles: [
      {'role': 'read', 'db': 'admin'},
      {'role': 'read', 'db': 'local'},
      {'role': 'read', 'db': 'config'},
      {'role': 'readWrite', 'db': 'singlestore'}
  ]})

  db.adminCommand({ createUser: 'cdcUser', 
    pwd: 's2mongoCDC12', 
    roles: ['cdcRole']
  })

  ```
  Refer to [Database Commands](https://www.mongodb.com/docs/manual/reference/command/) for more information.

## Allow Access to the MongoDB® Instance

To allow SingleStore to connect to your MongoDB® instance (MongoDB® Atlas or self-managed deployment), allow incoming traffic from the outbound IP addresses of your SingleStore Helios workspace group.

> **📝 Note**: Allow all the outbound IP addresses.

1. Copy the outbound IP address of your SingleStore Helios workspace.

   1. On the [Cloud Portal](https://portal.singlestore.com), select **Workspaces**. Select the three dots under the **Actions** column for your workspace, and then select **Access & Security** from the list.

   2. In the **Firewall** section, select **Outbound**. Copy all the IPs listed under **IPs for Outbound Connections**.

2. Allow incoming traffic to the MongoDB® instance from the SingleStore Helios outbound IP addresses. Follow the instructions for your deployment:

   * For MongoDB® Atlas deployments, add the outbound IPs to the MongoDB® **IP Access List**. Refer to [Configure IP Access List Entries](https://www.mongodb.com/docs/atlas/security/ip-access-list/) for related information.
   * For MongoDB® self-managed deployments, allow incoming traffic from the IP addresses. Refer to [Network and Configuration Hardening](https://www.mongodb.com/docs/manual/core/security-hardening/#network-hardening) for more information.

## Limitations

* SingleStore does not support data replication using CDC pipelines from MongoDB® Atlas standalone or serverless instances. Replication is only supported for replica set deployments.
* Because MongoDB® time series collections do not support change streams, they cannot be replicated in SingleStore using CDC. Refer to [Time Series Collection Limitations](https://www.mongodb.com/docs/manual/core/timeseries/timeseries-limitations/) for more information.

## In this section

* [Replicate MongoDB® Collections using MongoDB® Wrapper Commands](https://docs.singlestore.com/cloud/reference/singlestore-kai/replicate-mongodb-collections-to-singlestore/replicate-mongodb-collections-using-mongodb-wrapper-commands.md)
* [Replicate MongoDB® Collections using SQL](https://docs.singlestore.com/cloud/reference/singlestore-kai/replicate-mongodb-collections-to-singlestore/replicate-mongodb-collections-using-sql.md)
* [Replicate MongoDB® Collections via AWS PrivateLink](https://docs.singlestore.com/cloud/reference/singlestore-kai/replicate-mongodb-collections-to-singlestore/replicate-mongodb-collections-via-aws-privatelink.md)

***

Modified at: March 9, 2026

Source: [/cloud/reference/singlestore-kai/replicate-mongodb-collections-to-singlestore/](https://docs.singlestore.com/cloud/reference/singlestore-kai/replicate-mongodb-collections-to-singlestore/)

(An index of the documentation is available at /llms.txt)
