简体   繁体   中英

How smart is the firestore update protocol

I am implementing an application that updates a document each second.

All connected users are listening to this document.

The document that I update is quite big (ca 40k as json) but most of the times I am only updating a single field in that document.

So I wonder if I should break this data out into its own document or if the protocol that firebase/firestore uses is smart? Ie so that it only sends out the modifified data.

The Firestore client sends the data that you pass to the API call. So if you call documentRef.update() with a single field, it sends just the path to the document and that field. If you call documentRef.set() or .update() with more fields, it passes the path and those fields.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM