Reputation: 54
QuerySnapshot querySnapshot = await FirebaseFirestore.instance
.collection('collection-name')
.where("users", arrayContains: userRef)
.get();
List<CircleRecord> circles = [];
querySnapshot.docs.forEach((DocumentSnapshot doc) {
Map<String, dynamic> newData = doc.data() as Map<String, dynamic>;
newData['fieldName'] = 'Hello';
CircleRecord record = CircleRecord.fromMap(newData);
circles.add(record);
});
I need to change specific field value and store whole data in circle list with type of circleRecord document.
Upvotes: 1
Views: 211
Reputation: 599876
The CircleRecord
class in your code and error message is not part of any Firebase API. Specifically it is not something that is defined in the reference docs of the Firestore package.
Rather CircleRecord
it is a custom class that your have to define to represent the data from a document in Firestore. If you've never created such a class before, these search results show some good starting points: https://www.google.com/search?q=how+to+define+pojo+class+for+Firestore+in+Flutter
Upvotes: 0