# Feasibility to upsert the documents using Bulk operation

**URL:** https://discuss.elastic.co/t/feasibility-to-upsert-the-documents-using-bulk-operation/309289
**Category:** Elasticsearch
**Created:** [July 11, 2022, 6:35am UTC](https://discuss.elastic.co/t/feasibility-to-upsert-the-documents-using-bulk-operation/309289 "2022-07-11T06:35:36Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![bkantu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bkantu/32/107028_2.png) [@bkantu](https://discuss.elastic.co/u/bkantu)
#### Post date: [July 11, 2022, 6:35am UTC](https://discuss.elastic.co/t/feasibility-to-upsert-the-documents-using-bulk-operation/309289/1 "2022-07-11T06:35:36Z")

</div>

Hi Team,

Is there a way to insert a document if the document doesn't exist or else update the document in Elasticsearch using BulkAll?

How can we handle not duplicating the records if we do the import twice?

---

<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: [August 8, 2022, 6:36am UTC](https://discuss.elastic.co/t/feasibility-to-upsert-the-documents-using-bulk-operation/309289/2 "2022-08-08T06:36:20Z")

</div>

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