Firestore使用Java删除特定文档
连接到firestore数据库
Query query = dbFirestore.collection("collectionName").whereEqualTo("columnName ==",XXX);
ApiFuture<QuerySnapshot> apiFutureResults = query.get();
使用以下代码, apifuture,apifutureresults.get() ?如何从此处删除文档列表。在我的情况下,它只有一个文档用于给定条件。我没有在 apifutureresults 下看到任何删除函数。
fyi。这是纯Java应用。没有android。所以请不要听众。
Connected to the Firestore database using below code,
Query query = dbFirestore.collection("collectionName").whereEqualTo("columnName ==",XXX);
ApiFuture<QuerySnapshot> apiFutureResults = query.get();
From ApiFuture, apiFutureResults.get() ? How to delete the list of documents one by one from here. In my case its only one document for the given condition. I don't see any delete function underneath apiFutureResults .
FYI. This is pure Java Application. No Android. So No listeners please.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要逐一删除文档列表,您可以使用以下示例中使用delete()函数:
重要的是要注意,当您删除文档时,Cloud Firestore不会在其子策略中自动删除文档。通过参考,您仍然可以访问子集合中的论文。
必须删除文档手动任何子集合中包含的文档。
To delete the list of documents one by one, you can use the delete() function as in the following example:
It is important to note that Cloud Firestore does not automatically remove the documents in its subcollections when you delete a document. By reference, you can still access the papers in the subcollection.
A document must be deleted manually along with all of the documents contained in any subcollections.