我不确定如何开始/完成此操作,如果文档在特定时间段(例如 30 天)内未更改或访问,我希望 Firestore 数据库中的集合中的文档自行删除。换句话说,如果不需要,数据应该过期(被删除)。
有没有办法完成这个任务?
感谢您的帮助!
Run Code Online (Sandbox Code Playgroud)pub get failed: Because flutter_app depends on firebase_firestore ^0.12.7+1 which doesn't match any versions, version solving failed.
尝试flutter pub get在 pubspec.yaml 文件中运行时出现此错误。我目前正在尝试设置 firebase https://firebase.google.com/docs/flutter/setup。
这是我的 pubspec.yaml 文件:
name: flutter_app
description: A new Flutter application.
version: 1.0.0+1
environment:
sdk: ">=2.1.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2
# Add the dependency for the Firebase Core Flutter SDK …Run Code Online (Sandbox Code Playgroud) 我一直收到这个错误,我不知道如何修复它,因为昨天相同的代码起作用了。(这是一个测试应用程序,它使用谷歌地图和 firebase firestore 来保存和查询地图上的标记)
我认为这可能与我的 flutter 安装有关,所以我尝试使用稳定版和测试版,但在两个版本中都出现了相同的错误。
这是错误:
E/flutter (16809): [ERROR:flutter/lib/ui/ui_dart_state.cc(166)] Unhandled Exception: NoSuchMethodError: The method '<=' was called on null.
E/flutter (16809): Receiver: null
E/flutter (16809): Tried calling: <=(102.0)
E/flutter (16809): #0 Object.noSuchMethod (dart:core-patch/object_patch.dart:51:5)
E/flutter (16809): #1 GeoFireCollectionRef.within.<anonymous closure>.<anonymous closure> (package:geoflutterfire/src/collection.dart:125:31)
E/flutter (16809): #2 WhereIterator.moveNext (dart:_internal/iterable.dart:442:13)
E/flutter (16809): #3 new List.from (dart:core-patch/array_patch.dart:50:19)
E/flutter (16809): #4 new List.of (dart:core-patch/array_patch.dart:68:17)
E/flutter (16809): #5 Iterable.toList (dart:core/iterable.dart:404:12)
E/flutter (16809): #6 GeoFireCollectionRef.within.<anonymous closure> (package:geoflutterfire/src/collection.dart:126:16)
E/flutter (16809): #7 _MapStream._handleData (dart:async/stream_pipe.dart:219:31)
E/flutter (16809): #8 _ForwardingStreamSubscription._handleData (dart:async/stream_pipe.dart:157:13) …Run Code Online (Sandbox Code Playgroud) 我正在寻找一种通过文档 ID 而不是字段进行查询的方法。
它可能看起来像这样:
Firestore.instance.collection('tournaments').where(documentId, searchInput)
Run Code Online (Sandbox Code Playgroud)
在这种情况下searchInput是一个不完整的 documentId。
我在 Stackoverflow 上看到了一个解决方案,但它不适用于颤振:https : //stackoverflow.com/a/52252264/8539070
要记住的另一件事是,我试图显示集合中与 id 的某些部分匹配的所有文档的列表。
感谢您的帮助!
配额是包括所有项目还是每个 Firebase/谷歌云项目都是分开的?
我问这个问题是因为我想知道我是否应该在一个项目中包含多个应用程序以降低价格。关于组织,将应用程序拆分为多个项目会更好。
目前,我在 Google Cloud 上有一个应用程序项目和另一个项目来托管网站。(所有应用程序将使用同一个网站)
谢谢你的帮助!(我知道这不是一个编程问题,但作为使用 firebase 的程序员知道这很重要)