Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To update information in Firestore, you can use the update method provided by the DocumentReference class in the package:cloud_firestore package. The update method takes a Map parameter that contains the keys and values of the fields you want to update. For example:

FirebaseFirestore.instance
    .collection('users')
    .doc('abc123')
    .update({'name': 'John Doe', 'age': 30});

This code updates the name and age fields of the document with ID abc123 in the users collection.