I'm working with a collection which documents looks like these
Visit {
point: document-ref
}
the point contains the lat and long for the point.
As you can see, I'm retrieving the document for each visit. But I'm also having a huge problem: I'm rocketing my cloud usage.
Is there a way to do this without getting my usage up in the sky?
I'm using react with with react-redux-firebase
useSelector(({ firestore: { ordered: { visitas } } }) => {
return (
visitas &&
Promise.all(
visitas.map(async v => {
return { ...v, punto: (await v.puntoId.get()).data() };
})
).then(v => {setVisitas(v)})
);
});
I'm looking for a way to retrieve the documents, with the point already loaded in it.