gpt4 book ai didi

callback - Firebase - 推()回调

转载 作者:行者123 更新时间:2023-12-02 15:19:38 35 4
gpt4 key购买 nike

有什么方法可以使用 push() 方法找出我的数据何时保存在数据库中?我写了下面的代码,但它多次保存数据......

db.ref('news').push(opts).then(() => {
// do smth. (e.g. hide preloader) when data were succesfully saved
})

最佳答案

如果我没记错的话,push()回调应该是这样的:

db.ref('news').push(opts, function(error) {
if (error)
console.log('Error has occured during saving process')
else
console.log("Data hss been saved succesfully")
})

关于callback - Firebase - 推()回调,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38160591/

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com