简体   繁体   中英

Flutter & Firebase Updating documents

is there any way to update a field in a certain document when another document is updated !!

i have collection " Users " that hold users informations such as (Name, photoUrl...). and a collection " ChatsInfo " that hold the peer informations(Name, photoUrl...etc).

Alice is the user and Bob is the peer.

Alice has a document that contains Bob's information (Name, photoUrl...) stored in ( Users/AliceDoc/ChatsInfo ). now if Bob decided to update his profile pic which reside in a document inside Users collection . How do i make sure that Alice peer document which reside in a document in side ChatsInfo collection will get updated too!!

You can do with with a Firestore trigger running in Cloud Functions. I suggest looking into that. Please read from the documentation:

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