Posts

Showing posts from September, 2017

Bulk delete users in Fireabse

Firebase  is nice google owned service that lets you use database right from the browser, not much need for creating your own APIs. It is NoSQL type of DBs and you are responsible for building your indexes .. but this is not the point of this topic. It turns out that from the Authentication section it is not possible to bulk delete users. I have let the signInAnonymosly  while testing - and only to realize after some months that there are more than 800 users.. most of them just empty. It would be crazy to manually click and delete each of this users. A hackish way to do this is via the node firebase-admin package . After installing and configuring the private key, I wrote the following script: var admin = require ( " firebase-admin " ) ; var serviceAccount = require ( " ./admin_private_key/racket-tournaments-firebase-adminsdk-fheco-949023672f.json " ) ; admin . initializeApp ( { credential : admin . credential . cert ( serviceAccount ) , databaseU...