This is NOT a solution, if someone in China add +1 to counter and someone in Europe add +1 to counter it can take up to a few minutes before the value is synced, plus, if you do this in parallel you’ll have no idea what the “real” number is. If you need to do counters, you have to use an ACID database like FaunaDB.
Always test requests in parallel (load testing) before assuming that a distributed database will behave as you expect, in most cases it will not. There are a lot of hidden problems that might not be obvious, like function behaving like globals if you don’t instantiate a new class on every new request. What happens then is that the global will be overwritten with the data from a different users request.