Would it be possible to do relation in this sense in firestore ? whereby I want to relate a field in collection to another field in another collection
Eg: I have 2 different collection - tracking and venue
tracking <-- collection
1. document(xyz123)
device_unique_identifier = "abcd1234"
timestamp = 10/09/2019 10:00
2. document(xyz567)
device_unique_identifier = "efgh3456"
timestamp = 10/09/2019 11:00
venue <-- collection
1. document(zyx123)
name = "room A"
device_unique_identifier = "abcd1234" <-- this is unique name
2. document(zyx345)
name = "room B"
device_unique_identifier = "efgh3456" <-- this is unique name
I would like to query document xyz123 and get the name of the venue in the row. So the output would be:
document(xyz123)
device_unique_identifier = "abcd1234"
timestamp = 10/09/2019 10:00
venue.name = "room A"
Here is a screenshot how the data may look like:
Reason for tracking data, in a realtime use case, doesnt have the luxury (time) to query the name in venue collection, so insertion (writing) have to be in this way (meaning only the device_unique_identifier is available for insertion). Therefore, to do the relation, we would only do it in the query.
I would like advise how to model and query such a relation.