我已经通过从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文档
发布评论