Remove multiple data from firebase

Viewed 86

I uses a wrap of kreait/firebase-php for processing needed requests. I need to realize removing old data, but them too much for removing data one by one entry. How I can to remove multiple data by one request? this is an example of my current code:

$keys = [..keys of data ..];
foreach ($keys as $key) {
   $firebase->getReference(<collection> . '/' . $key)->remove();
}
1 Answers

Assuming you are asking about Firebase's Realtime Database, you can send a multi-path update request with the values for each key set to null to remove a lot of nodes in one go.

Related