google-cloud-firestore

Closure call with mismatched arguments: function '[]' error is being shown in flutter

◇◆丶佛笑我妖孽 提交于 2021-01-01 09:02:31
问题 In my program, this error comes in my laptop only. I typed the exact code as of the tutorial, but in tutorial, it is working fine, and i am getting this error - Closure call with mismatched arguments: function '[]' Receiver: Closure: () => Map<String, dynamic> from Function 'data':. Tried calling: []("message") Found: []() => Map<String, dynamic> This is my code, in which error is coming. If you want full details of functions, you can comment it out, and i will provide you the same in

Firestore onSnapshot -> Does it work for subcollections?

旧街凉风 提交于 2021-01-01 06:45:26
问题 Is the method onSnapshot of firestore triggered by any changes in subcollections? What is the difference between db.firestore.collection('x'). onSnapshot And db.firestore.collection('x').doc('y').collection('z'). onSnapshot Are they equal???? 回答1: A change to a subcollection organized under a document do not count as changes to the document itself. They will not trigger a snapshot event on that document. Listening to a subcollection is not any different than listening to a top-level

Time Field serverTimestamp() in cloud Firestore returns null on the first snapshot

两盒软妹~` 提交于 2021-01-01 04:42:51
问题 Im reading some data(messages) from Cloud Firestore and in a document i have a timestamp field for time. I have a Stream: Stream<QuerySnapshot> get chats { return chatCollection.document(roomid).collection("messages").snapshots(); } for getting the messages if a an update occurs in my database (ex New message). So when i start the app it reads all the data(messages) from the DB and i print them in my app. Here is what my console printing the messages every time i get a new snapshot: D

What is the right way to cancel all async/await tasks within an useEffect hook to prevent memory leaks in react?

帅比萌擦擦* 提交于 2020-12-30 08:40:11
问题 I am working on a react chap app that pulls data from a firebase database. In my "Dashboard" component I have an useEffect hook checking for an authenticated user and if so, pull data from firebase and set the state of a an email variable and chats variable. I use abortController for my useEffect cleanup, however whenever I first log out and log back in I get a memory leak warning. index.js:1375 Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it

Uploading and downloading files to/from Google Cloud Firestore

左心房为你撑大大i 提交于 2020-12-29 07:42:18
问题 I see that the Firebase has already a new beta version released, called Cloud Firestore. In the documentation all operations with the documents are described very well, but I am not able to find anything about uploading and downloading media files into the Cloud Firestore using Android... Does anyone has any information/tutorial etc for uploading/downloading media files (for example mp3 files and images)? Thank you very much in advance for the answers! 回答1: You can't store files to Firebase

couldnt import fireStoreModule correctly in angular

[亡魂溺海] 提交于 2020-12-27 06:35:14
问题 I am getting this error while running the angular project This likely means that the library (@angular/fire/firestore) which declares AngularFirestore has not been processed correctly by ngcc, or is not compatible with Angular Ivy. Check if a newer version of theen processed correctly by ngcc, or is not compatible with Angular Ivy. Check if a newer version of the library is available, and update if so. Also consider checking with the library's authors to see if the library is expected to be

Is there a way to filter data with Firebase UI RecyclerView?

大兔子大兔子 提交于 2020-12-27 06:33:47
问题 I'm using the Firebase UI FirestorePagingAdapter, i have a colletion of posts and i want to filter the post that are not from the current user and order them by timestamp I tried doing this but i get inequality error: override fun getPostFromLocation(viewLifecycleOwner:LifecycleOwner, location:String) :FirestorePagingOptions<Post>{ val query = firestore.collection(POST_COLLECTION) .orderBy("timestamp", Query.Direction.DESCENDING) .whereNotEqualTo("uid",auth.currentUser?.uid) return

Is there a way to filter data with Firebase UI RecyclerView?

余生长醉 提交于 2020-12-27 06:33:07
问题 I'm using the Firebase UI FirestorePagingAdapter, i have a colletion of posts and i want to filter the post that are not from the current user and order them by timestamp I tried doing this but i get inequality error: override fun getPostFromLocation(viewLifecycleOwner:LifecycleOwner, location:String) :FirestorePagingOptions<Post>{ val query = firestore.collection(POST_COLLECTION) .orderBy("timestamp", Query.Direction.DESCENDING) .whereNotEqualTo("uid",auth.currentUser?.uid) return

How to perform transactions in firestore when user is offline?

。_饼干妹妹 提交于 2020-12-27 06:28:28
问题 I'm creating a multi page application where i need to create and store transactions even when the users are offline. How do i achieve this using firestore ? Also i need some idea on how to persist the data received from the firestore locally. 回答1: You can't run transactions when offline,but if you think that your data is not changed while you are offline you can get the data from cache and update it it there using dbRef.addSnapshotListener(MetadataChanges.INCLUDE) and dbRef.update() 回答2: How

How to perform transactions in firestore when user is offline?

左心房为你撑大大i 提交于 2020-12-27 06:27:59
问题 I'm creating a multi page application where i need to create and store transactions even when the users are offline. How do i achieve this using firestore ? Also i need some idea on how to persist the data received from the firestore locally. 回答1: You can't run transactions when offline,but if you think that your data is not changed while you are offline you can get the data from cache and update it it there using dbRef.addSnapshotListener(MetadataChanges.INCLUDE) and dbRef.update() 回答2: How