title: Kafka connect- Mongodb Sink Connector
body: <p>I am new to kafka connector. I have been explore about it about a week. I have used create and update the mongodb via mongodb connector curl commands. I am bit struggling to understand the concept and implementation of below.</p>
  <ol>
  <li>We are registering curl command to connector at every time with unique name before producing the message. How it will be automated?. For example, If I pass the data from my application to producer should I call the curl command for each and every request?</li>
  </ol>
  <p>2)I need to maintain the history collection based on that I need to pass two collection and two topics (one for updating and one for creating). How will I manage with curl configuration.
  I will paste my curl update configuration below,</p>
  <pre><code>curl -X POST -H &quot;Content-Type: application/json&quot; -d '{&quot;name&quot;:&quot;test-students-update&quot;,
   &quot;config&quot;:{&quot;topics&quot;:&quot;topicData&quot;,
   &quot;connector.class&quot;:&quot;com.mongodb.kafka.connect.MongoSinkConnector&quot;,
   &quot;tasks.max&quot;:&quot;1&quot;,
   &quot;connection.uri&quot;:&quot;mongodb://localhost:27017&quot;,
   &quot;database&quot;:&quot;quickstart&quot;,
   &quot;collection&quot;:&quot;topicData&quot;,
   &quot;key.converter&quot;:&quot;org.apache.kafka.connect.storage.StringConverter&quot;,
   &quot;value.converter&quot;:&quot;org.apache.kafka.connect.storage.StringConverter&quot;,
   &quot;key.converter.schemas.enable&quot;:&quot;false&quot;,
   &quot;value.converter.schemas.enable&quot;:&quot;false&quot;,
   &quot;document.id.strategy&quot;:&quot;com.mongodb.kafka.connect.sink.processor.id.strategy.BsonOidStrategy&quot;,
   &quot;document.id.strategy&quot;:&quot;com.mongodb.kafka.connect.sink.processor.id.strategy.PartialValueStrategy&quot;,
   &quot;value.projection.list&quot;:&quot;tokenNumber&quot;,
   &quot;value.projection.type&quot;:&quot;whitelist&quot;,
   &quot;writemodel.strategy&quot;:&quot;com.mongodb.kafka.connect.sink.writemodel.strategy.UpdateOneTimestampsStrategy&quot;
  }}' localhost:8083/connectors
  </code></pre>