Я хотел бы обновить счет, используя облачную функцию
Я уже пробовал это
exports.rate = functions.https.onRequest((request, response) => {
admin
.firestore()
.collection()
.where("index", "==", request.index)
.get()
.then(snap => {
snap.forEach(x => {
const newRating = x.data().score + request.value;
firebase
.firestore()
.collection()
.doc(x.id)
.update({ score: newRating });
});
});
});