Replit Database - How do I return the list of keys as JSON?

Hello there,
I'm trying to make a submit system in Express, but I need it to be returned as a JSON.
I tried this:

but everytime i make a GET request to /getDataBase, it doesn't return anything. Could anyone help?

You are viewing a single comment. View All

makes sense, you defined ctr outside of the request body, that's not good. Put it inside the request body so it is set to 0 each time. (which you also didn't do, you only did var a; so a++ will be NaN) @Seven7Four4