Im working with React native and react-native-firebase
My objective is to add multiple docs(objects) to a collection at once. Currently, I have this:
const array = [
{
name: 'a'
},{
name: 'b'
}
]
array.forEach((doc) => {
firebase.firestore().collection('col').add(doc);
}
This triggers an update on other devices for each update made to the collection. How can I batch these docs together for ONE update?