title: How to group kafka topics in different dbs and collections with mongodb sink connector depending on kafka topic name or message key/value
body: <p>As the title states, I'm using debezium Postgres source connector and I would like MongoDB sink connector to group kafka topics in different collection and databases (also different dbs to isolate unrelated data) according to their names. While inquiring I came across with <code>topic.regex</code> connector property  at <a href="https://www.mongodb.com/docs/kafka-connector/current/sink-connector/configuration-properties/all-properties/" rel="nofollow noreferrer">mongo docs</a>. Unfortunately, <em>this only creates a collection in mongo for each kafka topic successfully matched against the specified regex</em>, and <strong>I'm planning on using the same mongodb server to harbor many dbs captured from multiple debezium source connectors</strong>. Can you help me?</p>
  <p>Note: I read this mongo sink setting <code>FieldPathNamespaceMapper</code>, but I'm not sure if it would fit my needs nor how to correctly configure it.</p>