I am working with a firebase firestore
Collection called users, which consists of unique ID documents.
My goal now is to add these users into an Array
.
(The usersCollection currently has 3 users stored with the currentUser.uid
)
Example:
fb.usersCollection.where("state", "==", 'online').get().then(querySnapshot => {
querySnapshot.forEach((doc) => {
const userName = doc.data().name
this.markerMy = { name: userName }
})
// adding userName to randomArray
const randomArray = []
randomArray.push(this.markerMy)
Currently, I can only figure out how to push one user into the Array, not multiple.