How do I update data inside documents without specifying the document ID?

前端 未结 1 1551
醉话见心
醉话见心 2021-01-24 07:59

Is there a way to update data inside documents without specifying the document ID,

But while going thorugh stackoverflow I saw this code



        
相关标签:
1条回答
  • 2021-01-24 08:34

    The Dart equivalent to code you posted would look like this:

    Firestore.instance.collection('users')
      .where('name', isEqualTo: 'Daniel')
      .getDocuments()
      .then((querySnapshot) {
        querySnapshot.documents.forEach((documentSnapshot) {
          documentSnapshot.reference.updateData({ ... });
        });
      });
    
    0 讨论(0)
提交回复
热议问题