Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to update other field based on email id in fire store android

enter image description here

This is my fire store database i am trying to update phone number based on email id .
below code i am trying to updated phone

firebaseFirestore.collection("Users")
                        .document("anilkt87@gmail.com")
                        .update("phone",897389121 );

but i am unable to update i am new in fire store can any one help me in this.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

firebaseFirestore.collection("Users")
                            .document("anilkt87@gmail.com")
                            .update("phone",897389121 );

This code mean you are operate a document that id is anilkt87@gmail.com, But it is a field value in you screenshot not id, In this scenario you have to run query first, Then update those documents.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading