google-cloud-firestore

Storing a text file in Firestore's text field removes line breaks

江枫思渺然 提交于 2021-02-09 07:00:55
问题 I am trying to store a CSV file in a text field inside Cloud Firestore. However Firestore is stripping out all line breaks and storing the entire CSV file as a single line. The Firestore Data Types documentation does not say anything about a restriction on the type of characters that can be stored other than they should be UTF-8: Up to 1,048,487 bytes (1 MiB - 89 bytes). Only the first 1,500 bytes of the UTF-8 representation are considered by queries. Is there a documented restriction? If

How do I convert a Firestore date/Timestamp to Date in Kotlin?

拜拜、爱过 提交于 2021-02-08 21:48:10
问题 i'm working with firestore, and getting stuck when i get the timestamp from firestore. how i convert this Timestamp(seconds=1556006384, nanoseconds=994000000) to Date in kotlin. my minimum SDK is 21 so the code below doesn't work val timestamp = it["time"] as com.google.firebase.Timestamp val milliseconds = timestamp.seconds * 1000 + timestamp.nanoseconds / 1000000 val tz = ZoneId.of("Asia/Jakarta (UTC+07:00)") val localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(milliseconds), tz

firebase return onSnapshot promise

不问归期 提交于 2021-02-08 21:19:46
问题 I'm using firebase/firestore and I'm looking a way to return promise of snapshot. onlineUsers(){ // i want to return onSnapshot return this.status_database_ref.where('state','==','online').onSnapshot(); } in other file I did componentDidMount(){ // this.unsubscribe = this.ref.where('state','==','online').onSnapshot(this.onCollectionUpdate) firebaseService.onlineUsers().then(e=>{ console.log(e) }) } I get the errors Error: Query.onSnapshot failed: Called with invalid arguments. TypeError:

Firebase Firestore rules: will get()'ing the document being checked counted as another read?

纵饮孤独 提交于 2021-02-08 19:32:07
问题 I have a code in Firestore security rules like this (showing only relevant parts): match /users/{userId} { function isUserDisabled(userId) { return get(/databases/$(database)/documents/users/$(userId)) .data.admin == true; } allow read: if true; allow write: if request.auth.uid == userId && !isUserDisabled(userId); match /posts/{postId} { allow read: if true; allow write: if request.auth.uid == userId && !isUserDisabled(userId); } } isUserDislabled() is a function that will be called in

What is offline data saving limit of Firestore?

大兔子大兔子 提交于 2021-02-08 17:57:57
问题 Firebase Database gives 10 MB of offline database cache limit as per their documentation but there is no mentioning of offline data limit for Firestore database. What is offline data saving limit of Firestore ? 回答1: As per Firebase Support Team Answer - As of the moment, there is no limit on the size of the cached data for Firestore , however, this lack of limit is a known issue. We intend to implement this on Firestore, though we cannot provide any timeline on when will this be released. So

What is offline data saving limit of Firestore?

ぐ巨炮叔叔 提交于 2021-02-08 17:57:22
问题 Firebase Database gives 10 MB of offline database cache limit as per their documentation but there is no mentioning of offline data limit for Firestore database. What is offline data saving limit of Firestore ? 回答1: As per Firebase Support Team Answer - As of the moment, there is no limit on the size of the cached data for Firestore , however, this lack of limit is a known issue. We intend to implement this on Firestore, though we cannot provide any timeline on when will this be released. So

What is offline data saving limit of Firestore?

♀尐吖头ヾ 提交于 2021-02-08 17:57:11
问题 Firebase Database gives 10 MB of offline database cache limit as per their documentation but there is no mentioning of offline data limit for Firestore database. What is offline data saving limit of Firestore ? 回答1: As per Firebase Support Team Answer - As of the moment, there is no limit on the size of the cached data for Firestore , however, this lack of limit is a known issue. We intend to implement this on Firestore, though we cannot provide any timeline on when will this be released. So

My Flutter app with Firestore experiences very slow queries when it is resumed from the background on Android

风格不统一 提交于 2021-02-08 15:10:42
问题 Using Flutter 1.20.2. My Flutter app uses Firestore as it's backend database. For the current version I am using and throughout the development of this mobile app I have noticed that if my app is in the background for a period of time (could be a few mins) then when I bring the app back into the foreground the queries are very slow to return data. This does not happen on iOS. It only happens on Android. I use CircularProgressIndicators when my app is busy retrieving data from Firestore. I am

My Flutter app with Firestore experiences very slow queries when it is resumed from the background on Android

℡╲_俬逩灬. 提交于 2021-02-08 15:09:18
问题 Using Flutter 1.20.2. My Flutter app uses Firestore as it's backend database. For the current version I am using and throughout the development of this mobile app I have noticed that if my app is in the background for a period of time (could be a few mins) then when I bring the app back into the foreground the queries are very slow to return data. This does not happen on iOS. It only happens on Android. I use CircularProgressIndicators when my app is busy retrieving data from Firestore. I am

Adding SearchField to StreamBuilder Reading from Firestore

给你一囗甜甜゛ 提交于 2021-02-08 15:04:57
问题 I have a program that I get a list of users from Firebase's cloud Firestore, and display them in a Listview using a StreamBuilder in Flutter. The number of users will be large, and I want to implement a search field in my streambuilder that will query results that match my search field. I want it to look like this: --photo credit: https://blog.usejournal.com/flutter-search-in-listview-1ffa40956685 My Streambuilder that looks like the following: StreamBuilder<QuerySnapshot>( stream: Firestore