in ic-stable-structures how to reset specific static, without dfx deploy backend --modre=reinstall
2 Likes
Depends on the data structure. If you’re running a BTreeMap, you can use the clear method, for example.
1 Like
I already tried that not sure if it’s actually worked, but I was having an error still.
static FILE_CONTENTS: RefCell<StableBTreeMap<String, ContentNodeVec, Memory>> = RefCell::new(
StableBTreeMap::init(
MEMORY_MANAGER.with(|m| m.borrow().get(MemoryId::new(5))),
)
);
1 Like
Without knowing what the error is, it’d be hard for us here to help
1 Like
In fact, I was talking about this one you already commented there
I think this is an issue of data migration like adding new field deleting a field renaming a field in a rust struct. However, there is should be a documentation about how to migrate with recommendations and best practices
For example, the methods from_byes of the method to_bytes in Impl Storable for MyStruct