【发布时间】:2020-05-24 08:00:19
【问题描述】:
我是新手,我想知道如何将数据从 firebase 实时数据库读取到对话流。我想比较 DNI(id) 并从该表中获取只有该 DNI(id) 具有的信息。
这是我的代码:
function askReunion(agent)
{
const dni = agent.parameters.dni ;
agent.add(`Wait a minute...`);
return admin.database().ref('reunion').once("value").then((snapshot) => {
var dniBd = snapshot.child("dni").val();
if( dni == dniBd){
agent.add(`here I will put the information of the dni ` );
}
else{
agent.add(`You dont have any appointment. ` );
}
});
}
这是我要读取结果的表格:
【问题讨论】:
标签: firebase firebase-realtime-database dialogflow-es