Я использую базу данных Firebase в реальном времени в приложении Android, и у меня есть такие данные:
Я хочу удалить «точку»: вкладка всех пользователей.
База данных в реальном времени

Я хочу сделать это с помощью облачных функций. Я не знаю, какой код поместить в index.js
Облачные функции IMG

const functions = require('firebase-functions');
const admin = require('firebase-admin');
admin.initializeApp();
/**
* @function HTTP trigger that, when triggered by a request, checks every message of the database to delete the expired ones.
* @type {HttpsFunction}
*/
exports.removeOldMessages = functions.https.onRequest((req, res) => {
const timeNow = Date.now();
const messagesRef = admin.database().ref('/users');
messagesRef.once('value', (snapshot) => {
snapshot.forEach((child) => {
if ((Number(child.val()['point'])) <= timeNow) {
child.ref.set(null);
}
});
});
return res.status(200).end();
});