我在Firebase日志控制台中一直有这些警告: “FIREBASE警告:查询字符串段无效:”
我检查了一切,但我找不到一些理由。
你有什么想法吗?
配置
{
"name": "functions",
"description": "Cloud Functions for Firebase",
"dependencies": {
"firebase-admin": "~5.8.1",
"firebase-functions": "^0.8.1"
},
"private": true
}
测试用例:一个非常简单的云功能:
exports.test = functions.database
.ref('/scores/{sportId}/{matchId}')
.onWrite(event => {
const sportId = event.params.sportId;
const matchId = event.params.matchId;
const awayTeamScore = event.data.child("awayTeamScore").val();
const dateLastUpdate = event.data.child("dateLastUpdate").val();
const homeTeamScore = event.data.child("homeTeamScore").val();
const status = event.data.child("status").val();
var awayTeamScoreSnapshot = event.data.child("awayTeamScore");
var dateLastUpdateSnapshot = event.data.child("dateLastUpdate");
var homeTeamScoreSnapshot = event.data.child("homeTeamScore");
var statusSnapshot = event.data.child("status");
return admin.database().ref(/indexMatchLeague/${matchId}).once('value').then(league => {
console.log(matchId, homeTeamScore, awayTeamScore, status);
/*
var promises = [];
league.forEach(leagueSnap => {
const leagueId = leagueSnap.key;
const leagueVal = leagueSnap.val();
console.log(leagueId, leagueVal);
});
return Promise.all(promises);
*/
return null;
});
});