To use MongoDB sources in database ingestion and replication tasks, review the following considerations.
Source preparation
•For incremental load and combined initial and incremental load jobs, ensure that the database user you specify in the MongoDB connection has the readAnyDatabase role. Also, grant the changestream and find actions to the user.
• For applications to open a change stream on a single database, grant changestream and find actions on all non-system collections in the database. Use the following statements to grant these privileges:
•For applications to open a change stream on an entire deployment, grant the changestream and find actions on all non-system collections for all databases in the deployment. Use the following statements to grant these privileges:
•Database Ingestion and Replication uses MongoDB change streams to access real-time data changes for a single collection, database, or entire deployment. Database Ingestion and Replication does not use the MongoDB oplog (operations log) for change data capture.
•Database ingestion and replication tasks move MongoDB data to the target as key-value pairs, where the key is the ObjectID and the value is the JSON string that comprises a BSON document. The tasks can’t load flattened data directly to the target.
•Data-type mappings are not available for MongoDB sources. All data is persisted on the target as string data.
•Incremental load operations track change data at the source by using the ObjectID as a unique key. The changed JSON string can then be applied to the target.
•Database Ingestion and Replication does not support time-series collections in incremental load jobs that have MongoDB sources.
•In incremental load operations, Database Ingestion and Replication retrieves the change records from the date and time specified as the restart point. For MongoDB sources, the default value for the restart point is the current time. You can specify a different date and time in Greenwich Mean Time (GMT).
•If schema drift occurs on the MongoDB source, the data in the BSON documents that are sent to the target reflect the schema changes. However, Database Ingestion and Replication does not specifically detect and report the schema changes.
•Database Ingestion and Replication supports MongoDB replica sets and sharded clusters as sources.
•If you use a Secure Agent group with multiple agents and the active agent goes down unexpectedly, database ingestion and replication jobs can automatically switch over to another available agent in the Secure Agent group. The automatic switchover occurs after the 15 minute heartbeat interval elapses. For database ingestion and replication jobs that have a MongoDB source, automatic switchovers are subject to following limitations:
- Jobs cannot have persistent storage enabled.
- Jobs that have Kafka targets must store checkpoint information in the Kafka header. For any jobs that existed before the July 2025 release, automatic switchovers can't occur because checkpoint information is stored in the checkpoint file in the Secure Agent.