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("[email protected]")
.update("phone",897389121 );
but i am unable to update i am new in fire store can any one help me in this.
CodePudding user response:
firebaseFirestore.collection("Users") .document("[email protected]") .update("phone",897389121 );
This code mean you are operate a document that id is [email protected]
, But it is a field value in you screenshot not id, In this scenario you have to run query first, Then update those documents.