I like the Firebase version 9 modules but I don't like doc
. It should be document
. This would match collection
, which isn't col
.
This code doesn't run:
import { doc, collection, deleteDoc } from '@angular/fire/firestore';
this.querySnapshot.forEach((doc) => {
deleteDoc(doc(this.firestore, 'users', doc.id));
});
I have to change it to
import { doc, collection, deleteDoc } from '@angular/fire/firestore';
this.querySnapshot.forEach((docElement) => {
deleteDoc(doc(this.firestore, 'users', docElement.id));
});
I'd rather change it to
import { document, collection, deleteDocument } from '@angular/fire/firestore';
this.querySnapshot.forEach((doc) => {
deleteDocument(document(this.firestore, 'users', doc.id));
});
I have two questions. First, how do I make this request to the Firebase team? Second, can I make an alias for the doc
module? I tried this but it didn't work.
import { doc, collection, deleteDoc } from '@angular/fire/firestore';
export class AppComponent {
document: Function = doc;
this.querySnapshot.forEach((doc) => {
deleteDoc(document(this.firestore, 'users', doc.id));
});
}
That didn't work. :-)