I keep failed to retrieve the data from subcollection “Diary” when trying on click on a RecyclerView. What I want is when I on click on a RecyclerView, it will display that data stored in the “Diary”. What’s the problem with my codes? RecyclerView Java codes: Stored data Java codes: Retrieve data Java codes: Database structure: Output: Answer I believe
Tag: google-cloud-firestore
Get the named of Collections from Document on Cloud Firestore
I want to get collections (Col01, Col02, Col03) from the document (Doc01). How can I approach this? Check the attached image. Thanks. Answer There is no API for getting a list of collection names that exist within your (Doc01) document. So, unfortunately, you cannot do that on Android. Because you are looking for sub-collections that are nested under a document,
How to retrieve arrays from FirebaseFirestore using Collections?
This is my Firestore database Now here I want to retrieve Description and No. of Options which is saved in the form of an array, my code above prints other details of the data as well, with respect to the topic name selected hence I’ve used whereEqualTo(“Topic Name”, message)as my query(where the message is the topic I select). How to
fhir.executeBundle replacing resource id…How to prevent this?
I am using this Java code to upload a resource to a FHIRstore. The resource is as follows But the id i am using(123456) is getting replaced by a hexadecimal number. This does not happen while using fhirstores.import method Is there any way to stop executeBundle method from replacing my id…as i want to use custom id in my resource?
Android Cloud Firestore document fields query
How to query all timestamps for a certain date (20210205) and certain user (ala) from Cloud Firestore in the below example? For now, I can download the entire document and filter it on the device. But it’s not effective. Answer You can filter for FieldPath.documentId() as shown here to get the ala document in a query. But as you commented
Is firestore callback method run in a separate thread?
I am fetching Firestore data through RX observable. Is it required to subscribe to it in a separate thread or Firestore callback run off the main thread by default? Also please share any references regarding the Firestore unit test. Answer Is it required to subscribe to it in a separate thread or Firestore callback run off the main thread by
How to get the data from x document and upload it to a new document called ‘name’ and then delete the old one in java
How to get the data from x document and upload it to a new document called ‘name’ and then delete the old one in java I’ve got this code snippet from a Bjorn Reemer but I am unable to get it working in android java Answer you should use a transaction
Filtered Recyclerview on spinner with selected class of the student?
I want get items on RecyclerView based on the student class selected in the spinner. The student has rollno,name, class to be displayed in the RecyclerView. For instance, I want students in class 8th. I am using firebase Firestore. Right now I have recyclerviw which fetches all the documents(students). Updated Code for Adapter is : And updated code for ClassView
Firebase firestore problem ‘Make sure to call FirebaseApp.initializeApp(Context) first’
I’m doing a new project in Android Studio. I’d like to make my project in latest version and with Firebase Firestore to keep data. I know that i need to put apply plugin: ‘com.google.gms.google-services’ but i don’t find how .. and with lot of research, someone said that it is included in the ‘com.android.application’.. I have included my google-services.json in
Why does my code do the OnComplete first and the OnSucces later even when OnComplete is above in the code?
Using OnComplete I want to retrieve my documentid. I need this docid inside the OnSucces. So it has to go in that order. Why hadn’t it? LesAdapter.java, with the documentID hardcoded to get good LOGS LOGS: Answer I’m assuming, and I could be wrong, but onComplete triggers as soon as the operation has completed, regardless of whether or not it