# What's the bahavior of badger if it cannot find the cell for Txn.Delete

**URL:** <https://discuss.dgraph.io/t/whats-the-bahavior-of-badger-if-it-cannot-find-the-cell-for-txn-delete/7383>\
**Category:** Badger\
**Created:** [June 26, 2020, 9:05pm UTC](https://discuss.dgraph.io/t/whats-the-bahavior-of-badger-if-it-cannot-find-the-cell-for-txn-delete/7383 "2020-06-26T21:05:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yangzh](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/yangzh/32/1633_2.png) [@yangzh](https://discuss.dgraph.io/u/yangzh)\
**Post date:** [June 26, 2020, 9:05pm UTC](https://discuss.dgraph.io/t/whats-the-bahavior-of-badger-if-it-cannot-find-the-cell-for-txn-delete/7383/1 "2020-06-26T21:05:07Z")

</div>

Will it simply return nil, or (like Txn.Get), return ErrKeyNotFound?

Thanks.

---

<div class="post-metadata">

**Author:** ![ibrahim](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/ibrahim/32/6387_2.png) [@ibrahim](https://discuss.dgraph.io/u/ibrahim)\
**Post date:** [June 27, 2020, 6:58am UTC](https://discuss.dgraph.io/t/whats-the-bahavior-of-badger-if-it-cannot-find-the-cell-for-txn-delete/7383/2 "2020-06-27T06:58:10Z")

</div>

Deletes in badger are logical deletes. We will insert a new key with the delete marker. So to answer your question, badger will return nil when you perform a delete.

> <https://github.com/dgraph-io/badger/blob/158d9271e1052082d6377ffa56483650129b726c/txn.go#L423-L437>

---

<div class="post-metadata">

**Author:** ![yangzh](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/yangzh/32/1633_2.png) [@yangzh](https://discuss.dgraph.io/u/yangzh)\
**Post date:** [June 29, 2020, 4:14pm UTC](https://discuss.dgraph.io/t/whats-the-bahavior-of-badger-if-it-cannot-find-the-cell-for-txn-delete/7383/3 "2020-06-29T16:14:51Z")

</div>

thanks for the clarification!
