How can I do batch writes/run transactions with firestore in an angular2 app?
https://firebase.google.com/docs/firestore/manage-data/transactions
If it\'s po
It's simple:
constructor(private db: AngularFirestore){}
inserting(){
//--create batch--
var batch = this.db.firestore.batch();
//--create a reference--
const userRef = this.db.collection('users').doc('women').ref;
batch.set(userRef , {
name: "Maria"
});
//--create a reference--
const userRef = this.db.collection('users').doc('men').ref;
batch.set(userRef , {
name: "Diego"
});
//--Others more 54 batch's--
//--finally--
return batch.commit();
}