I'm looking for guidance from any firebase/firestore users.
In particular I'm looking for best practice patterns when trying to get data from reference collections.
since I can't do a traditional join on a firebase/firestore db, I need a way to replace the normal sql queries when using firebase/firestore.
I have created workarounds, but nothing scalable.
e.g.
job collection contains a reference field to the company collection.
Results from job collection may look like this
{"name" : "Million dollar job", "company": { "$ref": "companies/pOjUBNOX9lHAsVkA2OEQ"} }
but I want this
{"name" : "Million dollar job", "company": "IBM" }
I have created a workaround by getting the entire companies collection and filtering it with javascript...
but this workaround is not scalable
(because companies collection will become thousands of rows)
here is the workaround code in a custom column
{{ getAllCompanies.data.filter(function(entry){return entry._id === currentRow.company.$ref.slice(-20)})[0].name }}
I was thinking that I could call an external function while iterating to getCompanyById, but I cant do trigger from a custom field (perhaps there is a sneaky way to do that?), I also can't call trigger from a transformer.
Does anyone have any solutions they have come up with?