# Fetch versions of data updated multiple times in badger

**URL:** <https://discuss.dgraph.io/t/fetch-versions-of-data-updated-multiple-times-in-badger/2329>\
**Category:** Users\
**Created:** [March 19, 2018, 1:35pm UTC](https://discuss.dgraph.io/t/fetch-versions-of-data-updated-multiple-times-in-badger/2329 "2018-03-19T13:35:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![asimpatnaik](https://avatars.discourse-cdn.com/v4/letter/a/0ea827/32.png) [@asimpatnaik](https://discuss.dgraph.io/u/asimpatnaik)\
**Post date:** [March 19, 2018, 1:35pm UTC](https://discuss.dgraph.io/t/fetch-versions-of-data-updated-multiple-times-in-badger/2329/1 "2018-03-19T13:35:10Z")

</div>

Hi,  
We are using badger for storing data against a given key. As and when an update happens, we update the data using the same key. Is it possible to retrieve all the states of the data using the key? Or will we always get the latest data if we read using the key?  
e.g. if the value for a given key transitioned from A to B to C, is it possible to retrieve all the state transitions?

Regards,  
Asim.

---

<div class="post-metadata">

**Author:** ![mrjn](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/mrjn/32/775_2.png) [@mrjn](https://discuss.dgraph.io/u/mrjn)\
**Post date:** [March 19, 2018, 5:07pm UTC](https://discuss.dgraph.io/t/fetch-versions-of-data-updated-multiple-times-in-badger/2329/2 "2018-03-19T17:07:21Z")

</div>

You can use this option to get all the previous versions:

> <https://github.com/dgraph-io/badger/blob/8b89769ed71e56cf7f80abdcfd3576efc97bd412/iterator.go#L255>

---

<div class="post-metadata">

**Author:** ![asimpatnaik](https://avatars.discourse-cdn.com/v4/letter/a/0ea827/32.png) [@asimpatnaik](https://discuss.dgraph.io/u/asimpatnaik)\
**Post date:** [March 20, 2018, 6:21am UTC](https://discuss.dgraph.io/t/fetch-versions-of-data-updated-multiple-times-in-badger/2329/3 "2018-03-20T06:21:31Z")

</div>

Thanks a lot. You saved me a lot of effort.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex007/uploads/dgraph/original/2X/2/2b38fdece2abe5814f2e51bee69d1e67fc304b0a.png) [@system](https://discuss.dgraph.io/u/system)\
**Post date:** [April 19, 2018, 6:21am UTC](https://discuss.dgraph.io/t/fetch-versions-of-data-updated-multiple-times-in-badger/2329/4 "2018-04-19T06:21:33Z")

</div>

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