I am trying to update a counter whenever a new document is added or deleted in my collection.
I have tried updating the counter on the frontend, whenever a document is cr