# Updating a value in JLD2

**URL:** <https://discourse.julialang.org/t/updating-a-value-in-jld2/29702>\
**Category:** General Usage\
**Tags:** jld2\
**Created:** [October 10, 2019, 12:26am UTC](https://discourse.julialang.org/t/updating-a-value-in-jld2/29702 "2019-10-10T00:26:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pixel27](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pixel27/32/8902_2.png) [@pixel27](https://discourse.julialang.org/u/pixel27)\
**Post date:** [October 10, 2019, 12:26am UTC](https://discourse.julialang.org/t/updating-a-value-in-jld2/29702/1 "2019-10-10T00:26:43Z")

</div>

Is it possible to update a value written to a JLD2 file? With version 1 there was a `delete!` method to delete the old value before writing it’s new value. With v2 I don’t see that method. I’ve looked for other methods in the source, but so far haven’t seen anything that implies delete.

Just writing the value again fails:

```julia
using JLD2;

file = jldopen("test.jld2", true, true, true)

write(file, "a", "xyz")
write(file, "a", "abc")

close(file)

```

```julia
ERROR: LoadError: ArgumentError: a group or dataset named a is already present within this group

```

---

<div class="post-metadata">

**Author:** ![JonasIsensee](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jonasisensee/32/4704_2.png) [@JonasIsensee](https://discourse.julialang.org/u/JonasIsensee)\
**Post date:** [September 1, 2021, 8:31am UTC](https://discourse.julialang.org/t/updating-a-value-in-jld2/29702/2 "2021-09-01T08:31:05Z")

</div>

> [@pixel27](#):
>
> Is it possible to update a value written to a JLD2 file? With version 1 there was a `delete!` method to delete the old value before writing it’s new value. With v2 I don’t see that method. I’ve

This is now possible.

```julia
using JLD2;

file = jldopen("test.jld2", "w")

write(file, "a", "xyz")
Base.delete!(file, "a")
write(file, "a", "abc")

close(file)

```
