
this's my result of next function :
db.collection('SOCIAL').get().then((snapshot) =>{
snapshot.docs.forEach(doc => {
dataNet.push(doc.data())
})
return dataNet
})
i need to have these values as a temps, but i can't do these
If by temps you mean that they are only "inside" your callback - then you can do something like this:
const snapshot = await db.collection('SOCIAL').get();
let dataNet = [];
snapshot.docs.forEach(doc => {
dataNet.push(doc.data())
})
// dataNet[0] is your object
Please note that you need to wrap this in an async function.