0

I have a double storage map.

pub type Schools<T: Config> = StorageDoubleMap<
        _,
        Blake2_128Concat,
        SchoolId,
        Blake2_128Concat,
        StudentId,
        SchoolData<T>,
    >;

With System.killStorage, I am able to delete single entry from this storage after fetching encoded storage key from chain state using primary and secondary key.

How can I delete all entries from this storage in one go?

1 Answer 1

0

I don't recommend do this with extrinsic.

This is no way to do this in one OP, it results in O(n) time complexity.


I suggest writing a migration for this.

If the storage is not that large.

If the storage is large.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.