Angularfire update on collectionGroup document causes infinite loop

I am trying to get a document from collection group by its name field and update some of its values using the following command:

this.afs.collectionGroup('operations', ref => ref.where('name', '==', operationName)).get().pipe(first()).subscribe(data =>[0].ref.update({}));

However, it causes an infinite loop of requests to firestore in my angular project. I’ve tried removing the update function ([0].ref.update({}) ->[0].ref), then all worked just fine. What am I doing wrong?

Source: Angular Questions