【发布时间】:2020-03-28 18:45:35
【问题描述】:
我目前正在尝试从当前存储在 firestore 中的数组中删除一个元素。
我已经检查了所有地方,即使是 Firestore 文档,他们的建议也不起作用。 这是目前我的代码,到目前为止它在尝试从列表视图中删除时什么都不做。
Map<String, Object> note = new HashMap<>();
note.put("posts", FieldValue.delete());
documentReference.update("posts", FieldValue.arrayRemove(listView.getItemAtPosition(position).toString()));
usersEmotions.remove(listView.getItemAtPosition(position).toString());
listView.setAdapter(listAdapter);
listAdapter.remove(listView.getItemAtPosition(position).toString());
【问题讨论】:
标签: android firebase google-cloud-firestore