I have the following data structure:
collection/
parent_document_1/
timestamp: 0
subcollection/
document/
belongsTo: parent_document_1
data: data
parent_document_2/
timestamp: 0
subcollection/
document/
belongsTo: parent_document_1
data: data
parent_document_3/
timestamp: 0
subcollection/
document/
belongsTo: parent_document_1
data: data
I want to sort parent_documents by their timestamp property, then make a collectionGroup query on the subcollection collection. I do not want to add an additional property to documents because the timestamp value under parent_documents is the ONLY value I want to sort on. The reason for this is that documents can be duplicates of one another, and timestamp needs to be updated for each parent_document individually.
The bigger picture is that I want to be able to query say, only the 3-5 most recently updated subcollections.
Is this possible to do with Firestore?