How use Trie.put

I wrote CRUD. I really want to write a method that will change the value in Trie. There are examples with Trie.put?

My code: Here are the difficulties with changing the balance field in the Trie

1 Like

Looking at similar code in the superheroes example, I think you might be wanting to call Trie.replace instead. Compare with:

2 Likes

Or perhaps the problem here is that you are passing Float.equal, not Nat32.equal, to compare the key (which I think is of type Nat32, not Float).

1 Like

First I made Trie.find and then I wanted to make this change and only then Trie.put or Trie.replace.
But How?

If you share your code in a gist (or a git repo), I could try to make it work for you.

1 Like

I found an answer from you here. Thank you

2 Likes