P
P
panikev2020-01-12 05:40:31
firebase
panikev, 2020-01-12 05:40:31

How to get multiple document id's and pass them to an array?

Hello! I already asked a question, but apparently it seemed incomprehensible or stupid to you =) I'll try to reformulate: Please tell me how to get a list of document IDs in Firebase, for further use in an array. After executing this code, the array is still empty.

ref.onSnapshot((querySnapshot) => {
    querySnapshot.forEach((doc) => {
        if (doc.data().Age !== undefined) array1.push(doc.id)
     })
     
 })
 console.log(array1 )

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question