# MongoDB Sink Document Id Strategy

**URL:** <https://forum.confluent.io/t/mongodb-sink-document-id-strategy/4702>\
**Category:** Managed Connectors\
**Created:** [6 April 2022 15:15 UTC](https://forum.confluent.io/t/mongodb-sink-document-id-strategy/4702 "2022-04-06T15:15:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexcocinda](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/alexcocinda/32/1768_2.png) [@alexcocinda](https://forum.confluent.io/u/alexcocinda)\
**Post date:** [6 April 2022 15:15 UTC](https://forum.confluent.io/t/mongodb-sink-document-id-strategy/4702/1 "2022-04-06T15:15:40Z")

</div>

I am trying to deploy a MongoDB Sink and I can find no description about the strategies used for generating document Ids. Could anyone shed some light on this?

---

<div class="post-metadata">

**Author:** ![daveklein](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/daveklein/32/140_2.png) [@daveklein](https://forum.confluent.io/u/daveklein)\
**Post date:** [6 April 2022 15:49 UTC](https://forum.confluent.io/t/mongodb-sink-document-id-strategy/4702/2 "2022-04-06T15:49:58Z")

</div>

You’ve probably already seen this, but [here’s a link](https://www.mongodb.com/docs/kafka-connector/current/sink-connector/configuration-properties/id-strategy/) to a page on the MongoDB site that discusses this topic.

Also, [here’s a link](https://www.mongodb.com/community/forums/t/how-to-get-kafka-event-key-string-as-the-document-id/121870) to a discussion on using the Kafka event key as the document id in Mongo.

If you’re still stuck, please post back here.

Dave

---

<div class="post-metadata">

**Author:** ![alexcocinda](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/alexcocinda/32/1768_2.png) [@alexcocinda](https://forum.confluent.io/u/alexcocinda)\
**Post date:** [7 April 2022 07:29 UTC](https://forum.confluent.io/t/mongodb-sink-document-id-strategy/4702/3 "2022-04-07T07:29:11Z")

</div>

Amazing, thank you so much. I didn’t even consider that there could be documentation from MongoDB about this.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/confluentcommunity/original/1X/c49438c90c9df282e9996fdf6971be890c71b65a.svg) [@system](https://forum.confluent.io/u/system)\
**Post date:** [14 April 2022 07:29 UTC](https://forum.confluent.io/t/mongodb-sink-document-id-strategy/4702/4 "2022-04-14T07:29:44Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
