I'm trying to delete multiple docs whith a specific String value in a Field from my collection. But im doing something wrong I think.
onPressed: () async {
Firestore.instance.collection('collection').getDocuments().then((snapshot) {
for (DocumentSnapshot ds in snapshot.documents.where(('field') == 'specificValue'){
ds.reference.delete();
});
});
}
Im currently trying to delete each Item with a loop after getting all documents, but im not able to delecte the specific Items. Because I'm getting an error under the "where" part.