What I want is simple and easy, but I don't know if it is possible to do it.
Func 1:
exports.readProducts = functions.https.onRequest(async (req, res) => {
//SOME CODE
});
Func 2:
exports.onCountChange=functions.database.ref('/ANALYTICS/count').onWrite((change, context) => {
//SOME CODE
});
I want this 2 functions to run like transaction, so if 2 people call/change the value at the same time, it should run one call at the time.