【发布时间】:2019-01-23 15:53:03
【问题描述】:
在 Dialogflow 中,我有一个名为 GetLocation 的 Intent。用户可以输入一个短语,例如:我想看看印度,参数“Location”存储该位置。对于我的参数,它的名称是“Location”,它的实体是sys.location。 Dialog Flow 能够识别我的位置。
接下来,Dialog Flow 写入我的 Firebase 数据库并写入数据库的位置参数(location:(来自 DialogFlow 的位置)。问题是,它不是正常写入数据库的位置参数,而是更改了“location”到管理区域:(来自 DialogFlow 的位置)。如何阻止它重命名 firebase 数据库中的位置参数?
这是我的履行代码:
function yourFunctionHandler(agent) {
const location = agent.parameters.Location;
return admin.database().ref('locations').transaction((locations) => {
if(locations !== null) {
locations.place = location;
agent.add(`Our recorded locations ` + location);
}
return location;
}, function(error, isSuccess) {
});
// return admin.database().ref('/locations/place').set(location);
}
【问题讨论】:
-
您能分享您的履行代码吗?它将数据写入 firebase 数据库。
-
好的,我刚刚添加了我的履行代码