Ask coding questions

← Back to all posts
How do I clear all keys from the Database?
maraujogosling

How do I clear all keys from the Database?

Voters
maraujogosling
Comments
hotnewtop
Coder100

Oh that's easy.

maraujogosling

@Coder100 thanks!!

gabegad123

@Coder100 is it possible to delete keys based on what they start with like db.list("x")?

Coder100
Coder100

but ofc, you can write your own:

@gabegad123

alanchen12

Just loop through all the keys in the dB then delete em. If you tell me what Lang I can provide an example

maraujogosling
alanchen12

In that case, you just use

If you have undeletable keys, I recommend forking. @maraujogosling

maraujogosling

@alanchen12 thanks!!