I do have not any familiarity with node/Js but I have 9 functions that I need to use in Firebase cloud functions, I made a scheduled function on a firebase in nodejs but it's not working as expected.
Just for clarification that the document that I want to update is in this hierarchy in firestore:
users (collection) -> abcUser (document) -> others (collection) -> limiter (document)
Below is one of the functions which is running succefuly on google cloud but the document is not getting update/change:
exports.resetLimiter = functions.pubsub
.schedule("*/5 * * * *")
.onRun( async (context) => {
const snapshot = await db.collection("users").get();
for (let i = 0; i < snapshot.docs.length; i++) {
await snapshot[i].query.get.collection("others").doc("limiter")
.update({
weeklyFlow: 0.0,
monthlyFlow: 0.0,
});
}
});
Peace!