skip to Main Content

Flutter – How to get a list of documents from Cloud Firestore using dart cloud_firestore package

I made a function to read a the data from a specific document and it works(code below) Future<List<String>> getAllServicesFromDatabase()async{ List<String> services = []; FirebaseFirestore db = FirebaseFirestore.instance; DocumentSnapshot<Map<String, dynamic>> results = await db.collection(dbCollection).doc(servicesDocument).get(); if(results.data() != null){ Map<String,dynamic> fetchedData = results.data()!;…

VIEW QUESTION

Firebase – how can i use serverTimestamp in angular/Fire in the compat mode

I have tried import firebase from 'firebase/compat/app'; import 'firebase/compat/firestore'; const firestore = firebase.firestore; this.form = this.builder.group({ items:[data.items, null], dateReported:[firestore.FieldValue.serverTimestamp(), Validators.required], ....}) i get this error: ERROR FirebaseError: Function WriteBatch.update() called with invalid data. Unsupported field value: a custom sl object…

VIEW QUESTION
Back To Top
Search