I have been working on this for a while now and I cannot seems to find a good/proper way to add objects coming from a DB query to an array holding objects. Please note I am developing a React Native Expo application.
This is basically the code that I have
var arr = [];
firebase.firestore().collection('Something').where("text", "==" , "text").get().then((querySnapshot) =>{
querySnapshot.forEach((doc) =>{
arr += doc.data();
})
})
The idea here is to have arr populated with the object result of doc.data(). I have looked at a million (if felt like it) tutorials, but I cannot seems to figure out the proper and correct way to populate my array.
Thank you for the help