我现在在Firebase中遇到问题。我尝试删除/删除特定数组数据的地方。最好的方法是什么?附言我只是Firebase/flutter的新手。
我的数据库结构:
我要在我的数据库结构中删除的数据(突出显示的一个):
最佳答案
首先创建一个空白列表,然后在列表中添加要删除的元素,然后使用下面的方法进行更新
Note : For this method you need the documennt id of element you want to delete
var val=[]; //blank list for add elements which you want to delete
val.add('$addDeletedElements');
Firestore.instance.collection("INTERESTED").document('documentID').updateData({
"Interested Request":FieldValue.arrayRemove(val) })
关于firebase - Flutter:如何在firebase中删除特定的数组数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59268817/