1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Flutter] Flutter - How to add a field to all documents in firebase collection

Discussão em 'Mobile' iniciado por Stack, Novembro 5, 2024 às 12:52.

  1. Stack

    Stack Membro Participativo

    I am using flutter firebase. And I want a query to add a key and value to all documents in firebase collection.

    I try to use batch write but it add a new documents having field. But not merge to existing documents.

    var db= Firestore.instance();
    var batch = db.batch();
    batch.setData(
    db.collection("users").document(),
    {"status": "Approved"}
    );


    When I try to give document Id like document('id') it add only to that document.

    I try many and watches YouTube videos but not able find still now. Please help me !

    Continue reading...

Compartilhe esta Página