Client Side Firebase for Data Consistency

From the shock rack below

Client Side Firebase for Data Consistency

Multichannel updates sound amazing. Is it the same for removing multiple paths?

Use case . I add a new message and unfolds for many followers. I decided to delete the message later. Does the job delete the same? Do you have an example?

+5
source share
1 answer

You can delete many messages in one operation by setting each key to null.

function deletePostFromFollowers(postId, followers) { var updates = {}; followers.forEach(function(followerId) { updates['/users/'+followerId+'/posts/+'postId] = null }); ref.update(updates); } deletePostFromFollowers('-K18713678adads', ['uid1', 'uid2']); 
+8
source

Source: https://habr.com/ru/post/1234608/


All Articles