In my Angular project, I am utilizing google-cloud-firestore
as the database. To import Firestore, I used the code
import { AngularFirestore } from '@angular/fire/firestore';
. The following function is used to add data to the database:
changeLevelToSelect() {
var student = {
id: 1001,
name: 'Tom',
age: 22
};
this.firestore.collection('School').add(student);
}
This function has been successfully implemented, and you can see the result https://i.sstatic.net/QBs7K.png.
In this particular case, I did not use the set()
method with a document name; rather, I utilized the add()
function. As a result, there are unique IDs assigned by Firestore instead of document names. Now I am facing an issue - how do I delete or modify this data without a specific document name for reference? Your assistance would be greatly appreciated.