how to update firebase document field angular

The solution for “how to update firebase document field angular” can be found here. The following code will assist you in solving the problem.

updateDoc(_id: string, _value: string) {
let doc = this.afs.collection(‘options’, ref => ref.where(‘id’, ‘==’, _id));
map(actions => => {
const data =;
const id =;
return { id, …data };
}))).subscribe((_doc: any) => {
let id = _doc[0]; //first result of query [0]
this.afs.doc(`options/${id}`).update({rating: _value});

Thank you for using DeclareCode; We hope you were able to resolve the issue.

More questions on [categories-list]

inline scripts encapsulated in