Is there a way to update document values in a Firestore collection for multiple records without manually specifying each document ID? Currently, I have a method that works for updating individual documents using their IDs, but what if I need to update a large number of records at once?
https://stackblitz.com/edit/angular-ea3wme
My goal is to have a functionality where clicking on the update
button changes the value of the state
column to
false</code for the respective row.</p>
<p><a href="https://i.sstatic.net/fAK6A.png" rel="nofollow noreferrer"></a></p>
<p><strong>myService.ts</strong></p>
<pre><code>updateState(){
// Need code here to update state for all documents
}
myComponent.ts
updateState(){
// Call updateState function from myService
}
myComponent.html
<td>
<button class="btn btn-outline-primary btn-sm" (click)="updateState()">Edit</button>
</td>