# Purge old versions of an object

**URL:** <https://discuss.elastic.co/t/purge-old-versions-of-an-object/32895>\
**Category:** Elasticsearch\
**Created:** [October 24, 2015, 1:15am UTC](https://discuss.elastic.co/t/purge-old-versions-of-an-object/32895 "2015-10-24T01:15:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thiago\_Dias](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thiago_dias/32/97322_2.png) [@Thiago\_Dias](https://discuss.elastic.co/u/Thiago_Dias)\
**Post date:** [October 24, 2015, 1:15am UTC](https://discuss.elastic.co/t/purge-old-versions-of-an-object/32895/1 "2015-10-24T01:15:24Z")

</div>

Hello guys, I have one doubt about versioning, I have a lot of object that can be updated many times and we are using version control to lead with it, my doubt is .. the older versions can be expunged, keeping just the new one version?  
The ES api provides a good way that we can do it?

Thanks for your attention,

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [October 24, 2015, 12:27pm UTC](https://discuss.elastic.co/t/purge-old-versions-of-an-object/32895/2 "2015-10-24T12:27:51Z")

</div>

And you're saving the versions as separate documents with some field indicating the current version number (or timestamp)? Or are you relying on ES's versioning mechanism?

---

<div class="post-metadata">

**Author:** ![Thiago\_Dias](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thiago_dias/32/97322_2.png) [@Thiago\_Dias](https://discuss.elastic.co/u/Thiago_Dias)\
**Post date:** [October 26, 2015, 11:52am UTC](https://discuss.elastic.co/t/purge-old-versions-of-an-object/32895/3 "2015-10-26T11:52:05Z")

</div>

Hello magnusbaeck, thanks for reply,

We're using the version\_type with external option, and the parameter we're using to determinate the version number is the timestamp like you've said.

Tks again,

---

<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:** [July 5, 2017, 11:42pm UTC](https://discuss.elastic.co/t/purge-old-versions-of-an-object/32895/4 "2017-07-05T23:42:41Z")

</div>


