MongoDB Sink Connector
Target connector
MongoDB Sink Connector
MongoDB Sink writes Kafka records into MongoDB collections. It is used when the target system is document-oriented rather than relational.
Parameters
| Category | Parameter | Required | Description |
|---|---|---|---|
| Basic | name | Yes | Unique target connector name. |
| Basic | connector.class | Yes | MongoDB sink connector class available in Kafka Connect. |
| Topics | topics / topics.regex | Yes | Kafka topics consumed by the connector. |
| Connection | mongodb.connection.string | Yes | MongoDB target connection string. |
| Mapping | database | Conditional | Target database name if not derived from topics. |
| Mapping | collection | Conditional | Target collection name if not derived from topics. |
| Write mode | delete.handling.mode | No | Controls how delete events are applied to MongoDB. |
| Runtime | max.batch.size | No | Batch size for writes. |