Ask coding questions

← Back to all posts
How do I clear all data from my repl database?
h
blbbrayan (46)

There have been quite a few bugs I've run into when using repl database.

The value's stored are not being stored as strings? When I save a value that is a string that contains a semicolon character, it throws an error when loading, thus deleting access to my stored data.

Also, I am seeing random entries in the database, and although that could be my fault, I can't delete them manually because the have \n in the name of the key.

Is there a way to mass delete data?

Is there a way to save semicolons without it being eval'd or throwing errors?



Comments
hotnewtop
Coder100 (19277)

hm...

I'll look into it

Alright, I think the fix would be to turn all your newlines to a JSON string,

becomes

until I can find a fix for the js lib

BixardGames (0)

This answer is late but I just came across this and thought I should share it for anyone needing to reset their replit DB.

To delete everything in your replit database you can use this code.

NoNameByProgram (200)

isn't there a delete thing in the database section while coding?

ironblockhd (427)

you can use \n to try and delete them, or database.empty() as specified in the docs: https://github.com/replit/database-node

blbbrayan (46)

@ironblockhd didn't work. It only delete the data that I actually purposefully saved... those weird glitchy ones are still saved after the db.empty() 🤯