Hi, i have a problem, i would like to add custom id (‘classification’) in my collection (‘pdpc’) but i seems lost.
this is my firebase.service.ts code.
export class FirebaseService {
private notes: Observable<Note>;
private noteCollection: AngularFirestoreCollection;
constructor(private afs: AngularFirestore) {
this.noteCollection = this.afs.collection<Note>('/pdpc/').doc('classification');
this.notes = this.noteCollection.snapshotChanges().pipe(
map(actions => {
return actions.map(a => {
const data = a.payload.doc.data();
const id = a.payload.doc.id;
return { id, ...data };
});
})
);
}
getNotes(): Observable<Note> {
return this.notes;
}