# UNABLE TO UPDATE THE DOCUMENT USING MONGODB LOGSTASH PLUGIN

**URL:** <https://discuss.elastic.co/t/unable-to-update-the-document-using-mongodb-logstash-plugin/250695>\
**Category:** Logstash\
**Created:** [October 1, 2020, 2:15pm UTC](https://discuss.elastic.co/t/unable-to-update-the-document-using-mongodb-logstash-plugin/250695 "2020-10-01T14:15:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Raja\_Kushwah](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/raja_kushwah/32/75131_2.png) [@Raja\_Kushwah](https://discuss.elastic.co/u/Raja_Kushwah)\
**Post date:** [October 1, 2020, 2:15pm UTC](https://discuss.elastic.co/t/unable-to-update-the-document-using-mongodb-logstash-plugin/250695/1 "2020-10-01T14:15:16Z")

</div>

Hi,

I am trying to migrate the data using logstash mongodb plugin .. I am able to migrate the data but it is failing while updating the data in mongo db as it is creating a new document while i am trying to append or update any field. I tried by creating a unique key also but still it is giving me duplicate id error eg.

[2020-09-28T10:41:00,459][WARN][logstash.outputs.mongodb][patient\_pipeline] Skipping insert because of a duplicate key error {:event=\>#LogStash::Event:0x6dee11af, :exception=\>#\<Mongo::Error::OperationFailure: E11000 duplicate key error collection: lzocsp.Patient index: id\_primary dup key: { : "70413" } (11000)\>}

Is the MongoDB plugin provide the feature to update the record from DB??

Thanks

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [October 1, 2020, 3:21pm UTC](https://discuss.elastic.co/t/unable-to-update-the-document-using-mongodb-logstash-plugin/250695/2 "2020-10-01T15:21:05Z")

</div>

> [@Raja\_Kushwah](#):
>
> Is the MongoDB plugin provide the feature to update the record from DB??

I do not think so, it [only does inserts](https://discuss.elastic.co/t/mongo-output-document-deletion/249693/2).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 29, 2020, 3:21pm UTC](https://discuss.elastic.co/t/unable-to-update-the-document-using-mongodb-logstash-plugin/250695/3 "2020-10-29T15:21:11Z")

</div>

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