3
我是firebase的新成员,我试图在函数中传递$variable
以检查$variable
是否存在。来自功能的Firebase返回输出
function ifExistWaybillNo(waybill_no)
{
var databaseRef = firebase.database().ref('masterlist');
databaseRef.orderByChild("waybill_no").equalTo(waybill_no).on('value', function(snapshot){
alert(snapshot.exists()); //Alert true or false
});
}
上述功能工作的罚款,但是当我改变alert(snapshot.exists());
到return snapshot.exists();
它不工作。它只是返回undefined,应该返回true
或false.
我该怎么做?在此先感谢
我会记住这一点,非常感谢。 –
没问题,开心编码。 – theblindprophet