下面的代码在控制台中产生一个null,我努力查看原因
var db = admin.database();
var ref = db.ref("/users/profile/{profileID}/points");
ref.on("value", function(snapshot) {
console.log(snapshot.val());
}, function (errorObject) {
console.log("The read failed: " + errorObject.code);
});
当我将var ref = db.ref("/users/profile/{profileID}/points");
替换为var ref = db.ref("/users/profile/aDCmad239kUZys/points");
时,会得到正确的输出。
知道为什么吗?