仍在检索已删除的Firestore文档

编程入门 行业动态 更新时间:2024-10-15 16:22:56
本文介绍了仍在检索已删除的Firestore文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我已经通过从Cloud Functions中的触发器中批量删除删除了一些文档.控制台显示它们已被删除,但是,我的应用程序仍会检索文档!这一定是firestore中的一个错误,这是一个非常重要的错误.我发现此处

I have deleted some documents through a batch delete from a trigger in Cloud Functions. The console shows them as being deleted, however, my app still retrieves the docs! This has got to be a bug with firestore and it's a pretty major one. I found another user had the same problem here

我正在使用的路径是/users/{id}/timeline/{postId}.我删除了特定的postId.

The path I'm using is /users/{id}/timeline/{postId}. I deleted a specific postId.

推荐答案

可能是您遇到了问题,该应用使用了缓存并从中加载了一些文档.您可以尝试的一件事是禁用离线持久性.

Probably you have the problem, that the app uses the cache and loads as well some documents from it. One thing you could try is to disable the offline persistence.

如果您使用的是带有实时数据库的Android 您可以尝试以下方法:

If you're using Android with Real-Time Database you could try this:

FirebaseDatabase.getInstance().setPersistenceEnabled(true);

iOS +实时数据库

Database.database().isPersistenceEnabled = true

如果您使用的是 FireStore ,请使用以下:

If you're using FireStore then use the following:

Android:

FirebaseFirestoreSettings settings = new FirebaseFirestoreSettings.Builder() .setPersistenceEnabled(false) .build(); db.setFirestoreSettings(settings);

iOS:

let settings = FirestoreSettings() settings.isPersistenceEnabled = false // Any additional options // ... // Enable offline data persistence let db = Firestore.firestore() db.settings = settings

更多推荐

仍在检索已删除的Firestore文档

本文发布于:2023-11-10 16:26:53,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1575888.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文档   Firestore

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!