繁体   English   中英

Firebase实时数据库iOS删除密钥

[英]Firebase Real-time Database iOS Delete Key

我的iOS应用程序上有一个正在运行的实时数据库。 现在,尝试从客户端添加功能以删除其user_id和历史记录。 根据文档,将为removeValue函数。 但是,当我运行时,我会收到一个快速错误。 这是我的代码:

 self.roofRef.child(user_name as! String).childByAutoId().setValue(dict)
 let conditionRef_ex = self.roofRef.child(user_name as! String)
 conditionRef_ex.observe(.value) { (snap: DataSnapshot) in
 let _tester = snap.value.debugDescription

 // here is line of code to remove user, which is causing the error    
 self.roofRef.removeValue(completionBlock: user_name as! (Error?, DatabaseReference) -> Void)

我看到的是:您必须填充removeValue方法的完成块...并且还可以通过将nil指定为另一个写操作(例如setValue或updateChildValues)的值来删除。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM