从 firebase 数据库中删除一个值

我正在尝试从 Firebase 数据库中删除一个节点,但没有任何反应。


这是我的代码:


FileInputStream serviceAccount = new FileInputStream(keyPath);


FirebaseOptions options = new FirebaseOptions.Builder()

    .setCredentials(GoogleCredentials.fromStream(serviceAccount))

    .setDatabaseUrl(databaseUrl)

    .build();


FirebaseApp.initializeApp(options);


DatabaseReference ref = FirebaseDatabase.getInstance().getReference();

ref.child("Users").child(uid).child("name").removeValue()

这是输出:


SLF4J:无法加载类“org.slf4j.impl.StaticLoggerBinder”。

SLF4J:默认为无操作 (NOP) 记录器实现

SLF4J:有关更多详细信息,请参见http://www.slf4j.org/codes.html#StaticLoggerBinder。


09-02-2018 05:43:53 PM - [START] - 开始动作:声明 - serviceAccount = new java.io.FileInputStream(keyPath) 09-02-2018 05:43:53 PM - [END] - 结束动作:语句 - serviceAccount = new java.io.FileInputStream(keyPath) 09-02-2018 05:43:53 PM - [开始] - 开始操作:语句 - options = new com.google.firebase.FirebaseOptions$Builder()。 setCredentials(com.google.auth.oauth2.GoogleCredentials.fromStream(serviceAccount)).setDatabaseUrl(databaseUrl).build() 09-02-2018 05:43:53 PM - [END] - 结束动作:声明 - 选项 = 新com.google.firebase.FirebaseOptions$Builder().setCredentials(com.google.auth.oauth2.GoogleCredentials.fromStream(serviceAccount)).setDatabaseUrl(databaseUrl).build() 09-02-2018 05:43:53 PM - [开始] - 开始操作:声明 - com.google.firebase.FirebaseApp。initializeApp(选项) 09-02-2018

05:43:53 PM - [END] - 结束动作:声明 - com.google.firebase.FirebaseApp.initializeApp(options) 09-02-2018

05:43:53 PM - [开始] - 开始动作:声明 - 参考= com.google.firebase.database.FirebaseDatabase.getInstance().getReference()

09-02-2018 05:43:53 PM - [END] - 结束操作:声明 - ref = com.google.firebase.database.FirebaseDatabase .getInstance().getReference()

09-02-2018 05:43:53 PM - [开始] - 开始行动:声明 ref.child("Users").child(uid).child("name").removeValue () 09-02-2018

05:43:53 PM - [END] - 结束动作:声明 - ref.child("Users").child(uid).child("name").removeValue() 09-02 -2018 年

05:43:53 PM - [PASSED] - 测试用例/V2/通用/草案 09-02-2018

05:43:53 PM - [END] - 结束测试用例:测试用例/V2/通用/草案


正如我所说,数据库没有任何变化。

有任何想法吗?


PIPIONE
浏览 186回答 1
1回答
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java